diff options
Diffstat (limited to 'contrib/ircstats2/crontab.script')
| -rwxr-xr-x | contrib/ircstats2/crontab.script | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/contrib/ircstats2/crontab.script b/contrib/ircstats2/crontab.script new file mode 100755 index 0000000..b21f2f5 --- /dev/null +++ b/contrib/ircstats2/crontab.script @@ -0,0 +1,45 @@ +#! /bin/sh +# +# Crontab script for ircstats2 +#------------------------------ +# You can use that script to check whether the stats generation script is +# running. +# +# No bugs are known in this software. So if it crashes, please tell me, even if +# you don't know anything about the crash ! +# +# To check for your script every 10 minutes, put the following line in your +# crontab: +# 0,30 * * * * /home/mydir/crontab.script +# And if you don't want to get email from crontab when it checks you script, +# put the following in your crontab: +# 0,30 * * * * /home/mydir/crontab.script >/dev/null 2>&1 +# + +# change this to the directory you run the script from: +ircstatsdir="/home/lucas/ircstats2" + +########## you probably don't need to change anything below here ########## + +cd $ircstatsdir + +if test -r ircstats2.pid +then + pid=`cat ircstats2.pid` + if `kill -CHLD $pid >/dev/null 2>&1` + then + exit 0 + fi + echo "" + echo "Stale ircstats2.pid file, erasing..." + rm -f ircstats2.pid +fi + +echo "" +echo "ircstats2.pl restarting ..." +echo "This software is supposed to be bug-free. If the bot has to restart," +echo "and if that's not for a good reason (server reboot for example), please notify" +echo "the author (lucas@schickler.net) even if you don't know why the script crashed." + +./ircstats2.pl +exit 0 |
