Running an endless loop in cron

Starting an infinite loop in a cron job. Suppose I wrote a script based php to run on my server using a cron job, and I want to use an infinite loop in this PHP script.
Any ideas for starting an infinite loop in a cron job.

+4
source share
1 answer

Endless loop applications are commonly called daemons. These are system services that offer some ongoing processing and / or willingness to accept some potential inbound processing.

Gearman is a system daemon that you can install, which can handle the various tasks that you give them. These are sophisticated tools that allow a lot, but can be used to fulfill your needs.

PHP :: Gearman is a Gearman client that talks to the Gearman daemon and sends tasks to the daemon, determining the conditions under which the task should be performed.

The limitations that @Jeffrey emphasized regarding PHP are true because PHP was designed as nothing architecture (loading one page equals one execution of the script - each page loading works within its own data context).

Perhaps System Daemon (the pear pack) can help overcome some or all of the limitations mentioned above. I have not used it, so I can’t tell you more about this, but it’s a good place to start, like everyone else.

+3
source

All Articles