Skip to content

Instantly share code, notes, and snippets.

View giorgos1987's full-sized avatar

Giorgos Papoutsis giorgos1987

View GitHub Profile
@giorgos1987
giorgos1987 / watchdog.sh
Created May 20, 2017 09:23 — forked from vodolaz095/watchdog.sh
watchdog.sh script for checking server running not mine, i stole it)
#!/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
#