1

I have a rails 3.2 app that you can upload a file then it provides a download link to download the file. I want the app to auto delete the files after a certain number of days/hours after it's been download. So this will clear up space in the app for more downloading. The upload files are going into public/data folder in my app. I have searched and can't seem to find much on this. I believe it my be some kind of script placed in my app but not sure how or where to start. Any help would be cool? Thanks!

Awhitey98
  • 167
  • 1
  • 2
  • 14

1 Answers1

0

Not an expert on rake tasks but I definitely know that you need to create a rake task for this one. Hope this is a starting guide into what you are after:

Erase records every 60 days

Destroying a Rails 3 object in rake?

You may also want to look at the following Railcasts episode 164 Cron in Ruby. There are a variety of scheduler gems to use.

Whenever Gem

Hope these resources help you.

Community
  • 1
  • 1
Deej
  • 5,334
  • 12
  • 44
  • 68
  • Thanks for the info! I will check into rake tasks as I'm not to familiar with it. Still in the learning process and trying to learn much as I can. – Awhitey98 Apr 02 '13 at 18:56
  • kind of seems like what I need but still can't figure out the right coding. – Awhitey98 Apr 03 '13 at 00:37