hafez ahmad wrote:
Dears,

I need to run PHP script every 10 seconds , I can do that with (while true) and sleep(10), but I need to the script always run on Linux machine as service.

Any Ideas?

While not as elegant as some of the other suggestions above, you could run "screen" to create a virtual terminal that remains active (even when you log off), then use the "watch" command to run a script every x seconds like so:

watch -n 10 ./myphpscript

Use CTRL-A D to drop out of the screen terminal and leave it running in the background.

~Rolan
_______________________________________________
New York PHP User Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/show_participation.php

Reply via email to