linux自己主动重新启动tomcat脚本
0.个人标记
caicongyang
http://blog.csdn.net/caicongyang
1.脚本retomcat.sh
#!/bin/sh pid=`ps aux |grep tomcat |grep -v grep |grep -v retomcat | awk '{print $2}'` echo $pid if [ -n "$pid" ] then { echo =====kill tomcat ========== kill -9 $pid sleep 3 echo =========startup.sh ============= /usr/local/tomcat/bin/startup.sh } else echo ===========startup.sh============= /usr/local/tomcat/bin/startup.sh fi
2.能够将以上的脚本增加crontab 中定时运行
我的CSDN博客地址: http://blog.csdn.net/caicongyang