linux tomcat一键维护脚本(值得收藏)

时间:2014-07-14 18:47:43   收藏:0   阅读:330
<span style="font-family: Arial, Helvetica, sans-serif;">#! /bin/sh</span>
a="/usr/share/tomcat7/webapps/ROOT"
b="/usr/share/tomcat7/webapps/ROOT.war"
c="ROOT.war"
tomcat_stop="/usr/share/tomcat7/bin/shutdown.sh"
sh "$tomcat_stop"
ps aufx | grep tomcat | grep root | awk '{print $2}' | xargs kill -9
rm -rf /usr/share/tomcat7/logs/catalina.out
if [ -d "$a" ]; then
	rm -r "$a"
fi

if [ -f "$b" ]; then
        rm  "$b"
fi

if [ -f "$c" ]; then
	cp "$c" "$b"
fi
d="/usr/share/tomcat7/bin/startup.sh"
sh "$d"
sleep 10
chmod +x work.sh

linux tomcat一键维护脚本(值得收藏),布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!