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,使他一直监视

posted @ 2018-01-08 16:04  matengfei  阅读(190)  评论(0编辑  收藏  举报