| 1 |
#!/bin/bash -e
|
| 2 |
|
| 3 |
# see README for more information
|
| 4 |
|
| 5 |
umask 002
|
| 6 |
. /srv/www.debian.org/cron/common.sh
|
| 7 |
|
| 8 |
# locking
|
| 9 |
if lockfile -! -l 43200 -r 0 "$crondir/often.lock"; then
|
| 10 |
echo `hostname` is unable to start update, lock file exists.
|
| 11 |
exit 1
|
| 12 |
fi
|
| 13 |
trap "rm -f $crondir/often.lock" exit
|
| 14 |
|
| 15 |
# rotate the previous log file
|
| 16 |
savelog -g debwww -m 664 $crondir/log/often.log > /dev/null
|
| 17 |
|
| 18 |
# making the time of job start explicit
|
| 19 |
date > $crondir/log/often.log
|
| 20 |
|
| 21 |
export CVS_RSH=ssh
|
| 22 |
cd $crondir
|
| 23 |
cvs update -d -P 2>&1 | tee -a $crondir/log/often.log >/dev/null
|
| 24 |
|
| 25 |
cd parts
|
| 26 |
run-parts --verbose $crondir/parts >> $crondir/log/often.log 2>&1
|
| 27 |
|
| 28 |
echo " *** the often cron job is done *** " >> $crondir/log/often.log
|
| 29 |
|
| 30 |
# making the time of job stop explicit
|
| 31 |
date >> $crondir/log/often.log
|