y=`date "+%Y"`
m=`date "+%m"`
d=`date "+%d"`
H=`date "+%H"`
M=`date "+%M"`
S=`date "+%S"`
name=“xxxxxcrm”
filename="$name.war"
file="/root/$filename"
backfile="/crm_web/back/$name-$y$m$d-$H$M$S.tgz"
if [ -f "$file" ] ; then
cd /crm_web/apache-tomcat-7.0.82/webapps
tar cvzf $name.tgz $name/
mv $name.tgz $backfile
echo $backfile
ps aux|grep java |grep -v grep|cut -c 9-15|xargs kill -9
rm -rf $name $filename
mv $file /crm_web/apache-tomcat-7.0.82/webapps/
cd /crm_web/apache-tomcat-7.0.82/
nohup ./bin/startup.sh &
cd /crm_web/apache-tomcat-7.0.82/logs
tail -f catalina.out
else
echo "$file is not exist!"
fi
tomcat.sh--测试上脚本,生产上估计也一样
猜你喜欢
转载自blog.csdn.net/little_dream2018/article/details/89189208
今日推荐
周排行