Reputation: 145
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
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