Windows XP Windows 7 Windows 2003 Windows Vista Windows教程綜合 Linux 系統教程
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟件教程
 Windows教程網 >> Linux系統教程 >> Linux系統常見問題解答 >> linuxtomcat一鍵維護腳本(值得收藏)

linuxtomcat一鍵維護腳本(值得收藏)

日期:2017/1/20 17:40:59      編輯:Linux系統常見問題解答
<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
Copyright © Windows教程網 All Rights Reserved