该脚本主要用于检查tomcat进程是否在线,如果不在线就启动tomcat服务
#!/bin/sh
res=`ps -ef|grep /home/xqlee/tomcat/bin/bootstrap.jar |awk '{if($0~"/usr/bin/java") print $2}'`
echo $res
if [ -z "$res" ]; then
cd /home/xqlee/tomcat/bin/ && ./startup.sh
fi
简单说明:
http://blog.xqlee.com/article/638.html