假设tomcat安装路径为 /home/tomcat,示例如下:
1. kill tomcat进程
vim kill-tomcat-force.sh
set fileformat=unix
path=/home/tomcat/binecho"exec $path/shutdown.sh"
$path/shutdown.shsleep3s#kill -9 pid
ps -ef|grep $path|grep tomcat|awk '{print $2}'|xargs kill-9#success msg
echo "shutdown success"
2. start tomcat
vim startTomcat.sh
echo 'start tomcat'
/home/tomcat/bin/startup.sh
sleep 3s
3. 查tomcat日志
vim showLog.sh
tail -f /home/tomcat/logs/catalina.out