linux守护进程的编写

linux监控一个进程进行

代码如下:

#!/bin/sh

cd /home/autoprocess/
auto=`pgrep -f autoProcessNew.php | wc -l`
if [ "$auto" = 0 ]
then
nohup php  autoProcessNew.php &
fi

监视autoProcessNew.php,使他一直监视

原文地址:https://www.cnblogs.com/matengfei123/p/8243187.html