Moving files after x hours

I’m trying to automate as much of my site as possible, and I’ve got to the point where all I have to do is move a file from, say, /temp/ to /files/ and the site will update all the appropriate pages. But it’s a bit tedious to log in a few times a day to keep things constantly updated, is there some function I can use in PHP to have the server automatically grab the first file in /temp/ and move it to /files/ every 8 hours (or however long)?

I’ve looked over the manual pages for sleep and sleep_until, but I’m not sure if those are what I’m looking for. If someone could point me in the right direction, I would be grateful! Thanks

Functions sleep() and sleep_until() are not good for your task. You need to use cron jobs scheduler to run a script that will perform required actions on set interval of times. If you have no access to configure cron jobs on your host, you can try any of free pseudo-cron php scripts (google it).

Sponsor our Newsletter | Privacy Policy | Terms of Service