зеркало из https://github.com/mozilla/pjs.git
Script for restarting mozbot from crontab. Based on a script by Joel Thornton <joelpt@eml.cc>. See bug 153043.
This commit is contained in:
Родитель
760ce0ed89
Коммит
4aa3dcd464
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# run-mozbot-from-crontab: Script for restarting mozbot from crontab
|
||||
# Originally written by <joelpt@eml.cc>
|
||||
#
|
||||
# This is good to use in your crontab for rebooting the bot
|
||||
# automagically upon its untimely demise. Use a line such as this in
|
||||
# your crontab:
|
||||
#
|
||||
# 0,5,10,15,20,25,30,35,40,45,50,55 * * * * $HOME/mozbot/run-mozbot-from-crontab
|
||||
#
|
||||
# Change the paths to your mozbot accordingly above and in the next
|
||||
# line.
|
||||
|
||||
cd $HOME/mozbot
|
||||
|
||||
# Create an empty .pid file first if it doesn't exist.
|
||||
touch ./mozbot.pid
|
||||
|
||||
ps -C mozbot.pl -o pid= | grep "`cat ./mozbot.pid`" ||
|
||||
( ( ./mozbot.pl >& /dev/null & ) ;
|
||||
ps -C mozbot.pl -o pid= | head --lines=1 > ./mozbot.pid )
|
Загрузка…
Ссылка в новой задаче