jenkins启动备份tomcat脚本

时间:2021-08-26 12:42:02   收藏:0   阅读:25

source /etc/profile
a_file=/home/test/tomcat/webapps/ROOT

a_cache=/home/test/tomcat/work/Catalina/localhost

a_pid=`ps aux|grep tomcat|grep test|grep jar|grep -v grep|awk ‘{print $2}‘`

if [ "$a_pid" != "" ];then

nohup /home/test/tomcat/bin/shutdown.sh >/dev/null 2>&1 &
kill -9 $a_pid
fi

if [ -d "$a_cache" ];then

rm -rf $a_cache
fi


if [ -d "$a_file" ];then

rm -rf $a_file

fi

原文:https://www.cnblogs.com/lyc77/p/15188767.html

评论(0)
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!