how to make a script run every 60 minutes...
Moderator: General Moderators
how to make a script run every 60 minutes...
in Linux, a solution would be to make a crontab job that would run the script in a browser and redirect the output to the NULL device so server activity continue normally. my question is: what's the line you use in linux console to open a browser with a certain adress?
often lynx -dump is used. (manual e.g. http://www.tru64unix.compaq.com/demos/ossc-v51a/man-htm/lynx-man.htm)
But having the cli version of php you do not need to redirect the execution through your webserver. Maybe you already have /usr/bin/php
edit: I should fix my <ctrl>-key, double pastes all day long
But having the cli version of php you do not need to redirect the execution through your webserver. Maybe you already have /usr/bin/php
edit: I should fix my <ctrl>-key, double pastes all day long
Last edited by volka on Wed Jan 08, 2003 4:20 am, edited 1 time in total.
One trick I used in the past is to check the age of the index file or some other file. Using something like filectime() I could check the amount of time since the last change. If it's greater than say 45 minutes, a subroutine of some sort could be triggered, at which point, the file is updated or "touched" (in linux, type in man touch at a command line).
Now this approach has it's drawbacks, but it's something that could be done when there is no cron option. Just be careful about whatever your triggering. Remember that there is someone waiting for your page to load.
Cheers,
BDKR
Now this approach has it's drawbacks, but it's something that could be done when there is no cron option. Just be careful about whatever your triggering. Remember that there is someone waiting for your page to load.
Cheers,
BDKR