Posted by Jonathan Wiltshire on 03/02/06 22:32
"Pol" <Pol@nospam.com> wrote:
> Can php scripts be initiated as a cron jobs running indefinately in a loop
> performing a task?
>
> Any recommendations for writing a php script that will run as an unix
> server process that will run indefinitely once it starts?
Yes. Ensure safe mode is off, and then you can use set_time_limit() to 0 to
disable
script killing. Call "php scriptname.php" from cron to launch it.
> If cron starts it every 10 minutes. How can I check if I my process is
> running and then end if an instance is already running?
If it's a server, why not try connecting to it and see if it times out? Then
you'd know
if it's responding or not. If you're happy with the command line, and safe
mode is off,
you can use exec() to run shell commands directly to kill it.
Jon
[Back to original message]
|