添加war 包 并重启tomcat的脚本
echo "stop tomcat..."
ps -ef|grep root|grep "tomcat"|grep java|grep -v grep|awk ‘{print $2}‘|xargs -i kill -9 {}
sleep 6
echo "stop tomcat done!"
#判断根目录下是否有XXXX.war,如果有的话,部署到services下
if [ -f XXXX.war ]
then
echo "根目录下有XXXX.war ,备份services下的XXXX.war,并将根目录下的aar包移动到services下"
if [ -f /usr/tomcat7/webapps/XXXX.war ]
then
echo "services下存在XXXX.war,先备份成bak"
mv /usr/tomcat7/webapps/XXXX.war /usr/tomcat7/webapps/XXXX.war_bak
fi
mv XXXX.war /usr/tomcat7/webapps/
rm -rf /usr/tomcat7/webapps/XXXX
fi
/usr/fzxt/tomcat7/bin/startup.sh
echo "start tomcat done!"
tail -f /usr/tomcat7/logs/catalina.out
时间: 2024-10-06 20:15:06