自动重启服务的shell脚本代码

admin 2018-10-08 0 次浏览


相关推荐: 每天自动重启命令  自动重启服务的shell脚本代码是  自动重启服务的shell脚本代码是什么  shell重启服务命令  自动重启程序的脚本  自动重启命令  shell脚本自动重启程序服务  shell脚本定时重启服务  linux重启自动启动服务  自动重启服务的shell脚本代码怎么写  shell脚本重启服务器 

自动重启故障相信大家都遇到过,原因也有很多,跟系统,硬件或者外界因素都有关。tomcat服务器有个过一段时间自动会挂的bug一直没能解决,挂的时候还要手动重启tomcat,于是决定写个脚本让它定时检测故障自动重启吧

代码如下:

#!/bin/bash

if [ ! -f /tmp/down_count ];then

echo "0" > /tmp/down_count

fi

curl -I tomcat-host -o "/tmp/status" >/dev/null 2>&1

请关闭浏览器的畅读模式或者取消屏蔽JavaScript的正常运行,避免出现内容显示不全或者段落错乱。

原网页地址:https://www.potelypower.com/xuexi/4022476.html