Page 1 of 1

auto-running script

Posted: Sun May 03, 2009 4:05 am
by dim_hatzi
hi everybody,
i would like to know if there is a possibility in php, to create a script, in order to call a .php file by scedule, for example every 1 hour... at server side...

thank you very much

dimitris - greece

Re: auto-running script

Posted: Sun May 03, 2009 5:17 am
by requinix
It's called cron, or the task scheduler for Windows.

Go be creative.

Re: auto-running script

Posted: Tue May 05, 2009 6:02 am
by requinix
Discuss? I kinda hoped the Google link I gave would be enough.

The exact mechanism depends on whether you use cron or the task scheduler. Either way, somewhere there is a rule that says that something should be done at a certain time. This happens automatically - you don't need to worry about your code checking the time or anything, the server does that for you. And when the time is right it executes your command.

Your command is to tell PHP to run some file of yours. The script loads, your code runs, and everybody's happy.