Skip to content

Instantly share code, notes, and snippets.

@kd7lxl
Created May 16, 2011 21:56
Show Gist options
  • Save kd7lxl/975460 to your computer and use it in GitHub Desktop.
Save kd7lxl/975460 to your computer and use it in GitHub Desktop.
Cron Watchdog
#!/bin/sh
if ps ax | grep pywxtd | grep -v grep > /dev/null
then
echo "service is running" > /dev/null
else
echo `date`: starting pywxtd after crash >> /var/log/pywxtd.log
/etc/init.d/pywxtd start
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment