Reply to Re: PHP script as a cron job

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация