创建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的进程赛程任务了。
Copyright © 2013-2024 8a.hk All Rights Reserved. 八艾云 版权所有 中山市八艾云计算有限公司 粤ICP备14095776号 粤公网安备 44200002445359号
增值电信业务经营许可证编号:B1-20222012
代理域名注册服务机构:西部数码