Fork me on GitHub

【Linux脚本】Java进程常驻

#!/bin/sh

while true
do
    for app_num in $(jps -m|grep EurekaServerApplication|wc -l)
    do
        # check service status
        if [ ${app_num} -lt 1 ];then
            echo "Process [${app_num}] not be found !"
            nohup sh /home/eurekaServer/bin/start.sh > /dev/null 2>1 &
        else
            echo "Process [${app_num}] has started... nothing to do"
        fi
    done
    sleep 10
done

 

posted @ 2022-03-05 23:51  罗西施  阅读(153)  评论(0)    收藏  举报