📂Java
🔖Tomcat
2023-12-26 09:44阅读: 15评论: 0推荐: 0

Tomcat自动化脚本

/bin/bash

war包名称

war_name="tchg.war"

要上传war包指定目录

war_dir="/usr/local/src/tchg"

工程地址

code_dir="/Lims/tchg/apache-tomcat-9.0.48/webapps/tchg"

tomcat地址

tomcat_dir="/Lims/tchg/apache-tomcat-9.0.48"

工程war地址

war_webapps="/Lims/tchg/apache-tomcat-9.0.48/webapps/"

kill tomcat进程

tomcat_pid=(psef|greptomcat|grepw/Lims/tchg/apachetomcat9.0.48/bin|grepvgrep|awkprint$2)kill9tomcat_pid
if [ ?ne0];thenechoe"\033[31m\033[01m[oldtomcatkillfailed]\033[0m"elseechoe"\033[32m[killoldtomcatsuccesswithpid:tomcat_pid ]\033[0m"
fi

删除 工程下的war包跟工程目录

rm -rf codedirrmrfwar_name
echo "delete last warnameprojectfilescode_dir"
cp -rf wardir/.warwar_webapps

重启tomcat

cd $tomcat_dir/bin
sh startup.sh

posted @   Kwoky  阅读(15)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起