Skip to content

Instantly share code, notes, and snippets.

@judeebene
Created August 26, 2017 13:49
Show Gist options
  • Save judeebene/345a48c6d2800965741ac42b16a97d86 to your computer and use it in GitHub Desktop.
Save judeebene/345a48c6d2800965741ac42b16a97d86 to your computer and use it in GitHub Desktop.
A simple cron job task to check if the app is top and start app in digital ocean every one hour
#!/bin/sh
# check if the bot is running
# ps auxw | grep "make run" | grep -v grep
# make run is the process to check , you can replace with a proces
if !(ps auxw | grep "make run" | grep -v grep)
then
/usr/bin/make -f ./Makefile run
fi
# use crontab -e to set the cron job
* 1 * * * /bin/sh/root/autoadd_bot/bot_launch.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment