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