This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Service watchdog script | |
# Put in crontab to automatially restart services (and optionally email you) if they die for some reason. | |
# Note: You need to run this as root otherwise you won't be able to restart services. | |
# | |
# Example crontab usage: | |
# | |
# Strict check for apache2 service every 5 minutes, pipe results to /dev/null | |
# */5 * * * * sh /root/watchdog.sh apache2 "" > /dev/null | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Service watchdog script | |
# Put in crontab to automatially restart services (and optionally email you) if they die for some reason. | |
# Note: You need to run this as root otherwise you won't be able to restart services. | |
# | |
# Example crontab usage: | |
# | |
# Strict check for apache2 service every 5 minutes, pipe results to /dev/null | |
# */5 * * * * sh /root/watchdog.sh apache2 "" > /dev/null | |
# |