Skip to content

Instantly share code, notes, and snippets.

@radiosilence
Created June 12, 2013 12:22
Show Gist options
  • Save radiosilence/5764790 to your computer and use it in GitHub Desktop.
Save radiosilence/5764790 to your computer and use it in GitHub Desktop.
A simple script to run via cron to make sure a process is running.
#!/bin/bash
VENV=/home/greencall/webapps/greencall
do_check () {
if ps ux | grep -v grep | grep "$1" > /dev/null
then
exit
else
echo "Restarted with command $1"
$1
fi
}
do_check "$VENV/bin/uwsgi --enable-threads --emperor $VENV/uwsgi.yaml --daemonize $VENV/uwsgi.log"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment