Linux用脚本守护进程

 

while true;
do
        server=`ps -aux | grep tomcat | grep -v grep`
        if [ ! "$server" ]; then
            echo "Tomcat挂了" | mail -s "Tomcat" xxxx@qq.com                                   
            break
        fi
        sleep 5
done

 

posted on 2017-12-14 12:28  WOTGL  阅读(3346)  评论(0编辑  收藏  举报

导航