3 # run-mozbot-from-crontab: Script for restarting mozbot from crontab
4 # Originally written by Joel Thornton <joelpt@eml.cc>
6 # This is good to use in your crontab for rebooting the bot
7 # automagically upon its untimely demise. Use a line such as this in
10 # 0,5,10,15,20,25,30,35,40,45,50,55 * * * * $HOME/mozbot/run-mozbot-from-crontab
12 # Change the paths to your mozbot accordingly above and in the next
17 # Create an empty .pid file first if it doesn't exist.
20 ps -C mozbot.pl -o pid= | grep "`cat ./mozbot.pid`" ||
21 ( ( ./mozbot.pl >& /dev/null & ) ;
22 ps -C mozbot.pl -o pid= | head --lines=1 > ./mozbot.pid )