shell 監控判斷進程是否存在,若是不存在就從新啓動腳本。

#!/bin/bashbash

while [ 1 ]app

dospa

SendMail_is_exstit=$(ps -ef | grep "feed SendMail" | grep -v grep | wc -l)it

if [ ${SendMail_is_exstit} == 0 ]sdk

thengrep

cd /var/www/sdkfeed/while

./app/Console/cake SendMailps

fi

sleep 60

done

相關文章
相關標籤/搜索