Antoine Wako
Antoine Wako

Reputation: 145

Clean tmp files on Heroku automatically

My rails app import CSV files, generate PDF document and send it in email, Its create a lot of tmp files and i would know the best way to automatically clean the tmp files and last generated documents

Thanks

Upvotes: 0

Views: 419

Answers (1)

fongfan999
fongfan999

Reputation: 2624

You can create a task to do this:

## lib/tasks/clean_temp_files.rb
desc 'Clean temporary files'

task clean_temp_files: :environment do
  ## Do something at here
end

Then, install Heroku Scheduler to execute this task daily:

rake clean_temp_files

Upvotes: 1

Related Questions