Linux重启Tomcat常用脚本

来源:互联网 发布:创度软件 编辑:程序博客网 时间:2024/06/04 19:02
#!/bin/bash# kill processps -ef|grep 'artworks'|grep -v 'grep'|awk '{print $2}'|xargs kill -s 9# clean cacherm -rf webapps/* work/* temp/*# start tomcat./bin/startup.sh# monitor logtail -f logs/catalina.out

注:ps -ef|grep 'artworks'会打印两个进程,一个是Tomcat的进程,另一个是grep 'artworks'的进程,因此需要使用grep -v 'grep'过滤掉这条,-v表示显示不匹配的其他行。

原创粉丝点击