Automate PHP Script

software development

#1

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?


#2

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.