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
时间: 2024-10-06 20:15:11