首页 > 代码库 > shell脚本中重启tomcat进程

shell脚本中重启tomcat进程

shell脚本

#! /bin/bashSHUTDOWN="/root/tomcat/bin/shutdown.sh"STARTTOMCAT="/root/tomcat/bin/startup.sh"echo "关闭tomcat"$SHUTDOWNps -ef |grep tomcat |grep /root/platform |grep -v ‘grep‘|awk ‘{print $2}‘ | xargs kill -9sleep 10echo "启动tomcat"$STARTTOMCAT

  

 注:先使用tomcat本身的shutdown命令关闭,再用杀进程的方式补偿,做到真正关闭tomcat

 

欢迎光临娇娇家的美衣阁 http://shop105984718.taobao.com/