nginx - How can I get rails/ngnix to cleanup /tmp/RackMultipart* files? -


when user uploads image, files build in /tmp

rackmultipart20101130-1130-1l2q8dt-0 rackmultipart20101130-1130-1t11oa9-0 rackmultipart20101130-1130-59nrpq-0 rackmultipart20101130-1130-6jdqem-0 rackmultipart20101130-11807-1usq3d8-0   rackmultipart20101130-11807-nns7dw-0 

how can rails / nginx / passenger clean these files after upload finished?

i'm using:

  • nginx 0.8.53
  • phusion passenger 2.2.15 (mod_rails/mod_rack)
  • ruby on rails 2.3.8
  • paperclip ruby gem upload images

the first thing comes mind rake task crontab clear /tmp directory time time.

  1. create new rake task in lib/tasks removes rackmultipart* files.
  2. execute rake task crontab each x hours.
  3. (optional) use whenever simplify step 2 (quite powerful in combination capistrano)

this said better ask paperclip clear files approach above remove temporary file still in use paperclip don't know how that.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -