Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm not familiar with server-side scripting, but I'm currently using a PHP application on Media Temple to cache JPEGs from four webcams hosted on a server located in the middle of the Indian Ocean. (Hence my reason for caching them in the US.)

The webcams are updated every five minutes. The PHP application stores the cached images in I would like to create a cron script to automatically delete the contents of "cache" (not the folder itself; just the files inside) at a regular interval.

share|improve this question

closed as not constructive by John Gardeniers, Ward, Lucas Kauffman, Michael Hampton, Scott Pack Oct 1 '12 at 14:01

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

su as root

$crontab -e

add the following line

*/5 * * * * rm -rf /server/cachefolder/*

the cache in the folder will be deleted every 5 mins

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.