Automate PHP Script

Automate PHP Script

Posted by: Anxiety35
Posted on: 2009-07-12 22:18:00

I wrote a small PHP script to check a directory and delete any files that are over 20 seconds old. The reason it's so short is because these files are being uploaded by a program I wrote and I want to clear out anything that isn't fresh.

I know I can automate a PHP script using a CRON job (not exactly sure how though), but the most often dreamhost lets you run one is every 10 minutes and I want to run it every 10-15 seconds.

Is there anything else I can do?

Re: Automate PHP Script

Posted by: erikjacobsen
Posted on: 2009-07-13 00:38:00

If this is what you really need, then you shouldn't be using shared hosting.

Try to rethink your problem. I imagine an uploaded file is used by some script, and that the script itself could delete the file after use.

Tags: cron jobuploaded