首页 > 系统服务 > 详细

Linux 重启Tomcat脚本

时间:2016-04-25 19:17:16      阅读:372      评论:0      收藏:0      [点我收藏+]

 

 

#!/bin/test_restart.sh #Author : Javen
#Desc : restart tomcat-test
 
tomcatpath="/home/local/testJaven/tomcat-test"
tomcatname="tomcat-test"
 
 
if [ $# -ne 1 ]; then
        ps -ef | grep java | grep ${tomcatpath};
        pid=$(ps -ef | grep java | grep ${tomcatpath} | awk {print $2})
else
        pid=$1
fi
 
echo -e "Before start ${tomcatpath}, should kill the same run, kill pid ${pid}, and will start new ${tomcatname}  \c"
kill -9 $pid
sleep 9
cd ${tomcatpath}/bin
./startup.sh

 
如果执行提示没有权限 添加一下执行权限 chmod +x test_restart.sh 

Linux 重启Tomcat脚本

原文:http://www.cnblogs.com/zyw-205520/p/5432158.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!