守护进程的写法

#!/bin/bash
while true
do
        res=`ps -ef | grep "ci.hrdsm.com/server1" | grep -v grep | wc -l`
        if [ $res -eq 0 ]
        then
sh /export/server1/bin/start.sh
echo  $(date)" starting......"
        fi
        sleep 30s
done

  

posted on 2020-04-21 09:07  harrell  阅读(154)  评论(0编辑  收藏  举报