User blogs

Tag search results for: "cron"

So you have a php script you wish to keep running forever

Create bash file -


ps aux | grep '[d]aemon.php'

if [ $? -ne 0 ]


    php /home/acct/public_html/daemon.php


Create a cron job for every minute

* * * * * /bin/sh

or run it this way on CLI: 
nohup /bin/sh &

But when the system reboots, it is gone

marko Nov 20 '19 · Tags: php, ssh, cron