没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
#!/bin/bash
URL8080="http://aiyuetuan.ebeiwai.com:8080/check.jsp"
pid8080=`ps -ef|grep tomcat6-1 | grep -v "grep"|awk '{print $2}'`
URL9080="http://aiyuetuan.ebeiwai.com:9080/check.jsp"
pid9080=`ps -ef|grep tomcat6-2 | grep -v "grep"|awk '{print $2}'`
curlit8080()
{
curl --connect-timeout 10 --max-time 3 --head --silent "$URL8080" | grep '200'
}
curlit9080()
{
curl --connect-timeout 10 --max-time 3 --head --silent "$URL9080" | grep '200'
}
doit()
{
if ! curlit8080; then
sleep 10
#top -n 1 -b >> /var/log/log.log
kill -9 $pid8080 > /dev/null 2>&1
sleep 1
cd /usr/tomcat6-1/work/
rm -rf *
/usr/tomcat6-1/bin/catalina.sh start
echo $(date) "Tomcat8080 Restart" >> /var/log/trs/log8080.log
sleep 60
if ! curlit8080; then
echo "@"
echo $(date) "Failed!" >> /var/log/trs/log8080.log
fi
fi
URL8080="http://aiyuetuan.ebeiwai.com:8080/check.jsp"
pid8080=`ps -ef|grep tomcat6-1 | grep -v "grep"|awk '{print $2}'`
URL9080="http://aiyuetuan.ebeiwai.com:9080/check.jsp"
pid9080=`ps -ef|grep tomcat6-2 | grep -v "grep"|awk '{print $2}'`
curlit8080()
{
curl --connect-timeout 10 --max-time 3 --head --silent "$URL8080" | grep '200'
}
curlit9080()
{
curl --connect-timeout 10 --max-time 3 --head --silent "$URL9080" | grep '200'
}
doit()
{
if ! curlit8080; then
sleep 10
#top -n 1 -b >> /var/log/log.log
kill -9 $pid8080 > /dev/null 2>&1
sleep 1
cd /usr/tomcat6-1/work/
rm -rf *
/usr/tomcat6-1/bin/catalina.sh start
echo $(date) "Tomcat8080 Restart" >> /var/log/trs/log8080.log
sleep 60
if ! curlit8080; then
echo "@"
echo $(date) "Failed!" >> /var/log/trs/log8080.log
fi
fi












yuejinshan2000
- 粉丝: 0
- 资源: 3

上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
已下载
下载帮助

看过该资源的人还看了
安全验证
文档复制为VIP权益,开通VIP直接复制

- 1
- 2
- 3
前往页