Best way to handle this problem?

Hi,
We need some sort of system that will delete a file after it has been on our server for an hour. Basically, our PHP script generates a random URL for the download of our software, and within an hours time we would like that software to be deleted after an hour.

So far we have thought of creating a CronJob after the random location is created and have it set to run an hour after the file is created. Or we have thought of just setting up a CronJob on a PHP script to run every hour and delete and files that are over an hour old.

Both examples are not as efficient as we would like them to be. Does anyone know of any better method? Thanks.

 

 

 

 

Top