I\'m trying to set up a cron job as a sort of watchdog for a daemon that I\'ve created. If the daemon errors out and fails, I want the cron job to periodically restart it...
It's suprising that no one mentioned about run-one. I've solved my problem with this.
apt-get install run-one
then add run-one before your crontab script
*/20 * * * * * run-one python /script/to/run/awesome.py
Check out this askubuntu SE answer. You can find link to a detailed information there as well.