美文网首页
shell脚本:tomcat重启

shell脚本:tomcat重启

作者: LittleJessy | 来源:发表于2019-02-12 17:35 被阅读0次

restart.sh


#! /bin/bash

tomcat_home=/usr/local/tomcat/apache-tomcat-9.0.7/
SHUTDOWN=$tomcat_home/bin/shutdown.sh

STARTTOMCAT=$tomcat_home/bin/startup.sh

echo "stop $tomcat_home"

$SHUTDOWN


ps -ef |grep tomcat |grep $tomcat_home |grep -v 'grep'|awk '{print $2}' | xargs kill -9

rm  $tomcat_home/logs/* -rf
rm  $tomcat_home/work/* -rf


sleep 5

echo "run $tomcat_home"

$STARTTOMCAT

相关文章

网友评论

      本文标题:shell脚本:tomcat重启

      本文链接:https://www.haomeiwen.com/subject/cdikeqtx.html