守护脚本

stillRunning=$(ps -ef |grep usa-console |grep -v "grep") if [ "$stillRunning" != "" ] ; then echo "[`date +%y-%m-%d-%H:%M:%S`] service was already started" >> guard.log else echo "[`date +%y-%m-%d-%H:%M:%S`] service was not started and restart now" >> guard.log sh /home/admin/usa-console/bin/appctl.sh restart >> guard.log fi

猜你喜欢

转载自my.oschina.net/u/2302503/blog/1802725