
Centos7 apache守护(定时检测apache状态)
2022-11-10 10:33
阅读量:6610
创建apache_status.sh文件,并写入以下代码:
vi /root/apache_status.sh
pgrep -x httpd &> /dev/null
if [ $? -ne 0 ];then
bash /www/server/panel/script/rememory.sh
/etc/init.d/httpd start
fi
:wq #保存退出
2,crontab -e 进入编辑crond服务,添加如下命令:
*/5 * * * * /root/apache_status.sh
:wq #保存退出
3,重启crond服务
systemctl restart crond
这样就完成了apache的进程赛程任务了。
- Tags:
- apache
上一篇:Centos7 手动安装nodejs
下一篇:Centos7 mysql守护(定时检测mysql运行状态)