IT序号网

tomcat 启动和关闭脚本

flyfish 2021年05月27日 程序员 273 0

start.sh

#!/bin/sh 
 
. ~/.bash_profile 
echo "" > ${TOMCAT_HOME}/logs/catalina.out; 
sh ${TOMCAT_HOME}/bin/startup.sh 
tail -f ${TOMCAT_HOME}/logs/catalina.out

stop.sh

#!/bin/sh 
 
#set -x 
. ~/.bash_profile 
 
sh ${TOMCAT_HOME}/bin/shutdown.sh 
 
proc_count=`ps -ef | grep -v grep | grep tomcat | wc -l` 
if [ ${proc_count} -gt 0 ];then 
        ps -ef |grep -v grep | grep tomcat | awk '{print $2}' | xargs kill -9; 
fi 

评论关闭
IT序号网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!