强制关闭tomcat进程,并拷贝包并重新启动tomcat:

export JAVA_HOME=/yougo/java
echo ‘尝试关闭tomcat…’
sh bin/shutdown.sh;
tom_pid=ps -ef|grep group-new|grep -v grep| awk '{print $2}'
#如果tom_pid长度不为零 not-zero
if [ $tom_pid ];
then
echo “tomcat 关闭失败,将强制结束进程:$tom_pid”
kill -9 $tom_pid;
fi
echo “tomcat 进程结束”
echo “清空weapps目录并复制新war包…”
rm -rf webapps/*
cp *.war webapps/;
echo “重新启动tomcat…”
sh bin/startup.sh

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐