一个shell脚本
来源:互联网 发布:东方财富通mac版 编辑:程序博客网 时间:2024/04/29 15:54
if [ -d /home/apache-tomcat-7.0.21/webapps/trs ]; then if [ -d /home/apache-tomcat-7.0.21/webapps/trs.backup ];then rm -rf /home/apache-tomcat-7.0.21/webapps/trs.backup fi mv /home/apache-tomcat-7.0.21/webapps/trs /home/apache-tomcat-7.0.21/we bapps/trs.backupfiPID=`ps -ef | grep 'catalina' | grep -v 'grep' | awk '{print $2}'`if [ -z $PID ]; then echo "no catalina PID"else sh /home/apache-tomcat-7.0.21/bin/shutdown.shfirm -rf ./trs.warecho "rm trs.war"exit 0