Apache: Check kalau apache mati & restart automatis

From OnnoWiki
Revision as of 18:45, 8 April 2018 by Onnowpurbo (talk | contribs) (Created page with "Script #!/bin/bash if [ `pgrep apache2 -c` -le "0" ]; then /etc/init.d/apache2 restart fi Masukan ke crontab */5 * * * * /usr/local/bin/check-apache2.sh")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Script


#!/bin/bash
if [ `pgrep apache2 -c` -le "0" ]; then
/etc/init.d/apache2 restart
fi


Masukan ke crontab

*/5 * * * * /usr/local/bin/check-apache2.sh