Forum Moderators: coopster
I made a PHP script that creates an HTML file. I want that script to execute every hour.
I have a virtual hosting account so I don't know how much I can do, i.e. setting up a proper cron job.
Any ideas?
Also, if people are constantly hitting the HTML page that my PHP script creates will PHP overwrite the file properly so it gets used when it's written to disk?
Thanks.
If so, type "crontab -e". If you get no errors enter your cron job, and make sure it's saved.
Rather than writing to the active file I think it's probably a better idea if you write to a temporary file, delete the orignal, then move the temp file into place. Less chance of users getting half a page IMHO.
Cheers,
BAD
Alternative, what about a page that creates the new content when you access it and a cron job ("at" under windows) that triggers the script every day. Yeah, that'd be better I think.
HTH,
BAD