技術文檔
創建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的進程賽程任務了。
標簽: