Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Crontab; start a program if it is not running
#!/bin/sh
if ps -ef | grep -v grep | grep program.sh ; then
exit 0
else
~/scripts/program.sh >> /dev/null &
echo "Restarting program.sh, it was not running." | wall
exit 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment