X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fdebian%2Fcron.hourly;h=0c460a6bd8b1e7146c5242f1fc6e91a5982cdf50;hb=d7ed6e68e1b566f0462b742013884174898b57b7;hp=c20f4d1da3add2861129c7904f9cd26d2c4fb81b;hpb=2db23ca1db6661d55b82a75bbd5aeeef60e9b429;p=dak.git diff --git a/config/debian/cron.hourly b/config/debian/cron.hourly index c20f4d1d..0c460a6b 100755 --- a/config/debian/cron.hourly +++ b/config/debian/cron.hourly @@ -1,26 +1,43 @@ -#! /bin/sh +#! /bin/bash # # Executed hourly via cron, out of dak's crontab. set -e +set -o pipefail set -u export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars . $SCRIPTVARS +PROGRAM="Hourly" +######################################################################## +# Functions # +######################################################################## +# common functions are "outsourced" +. "${configdir}/common" + dak import-users-from-passwd -dak queue-report -n > $webdir/new.html -dak queue-report -8 -d new,byhand,proposedupdates,oldproposedupdates -r $webdir/stat -dak show-deferred -r $webdir/stat > ${webdir}/deferred.html -dak graph -n new,byhand,proposedupdates,oldproposedupdates,deferred -r $webdir/stat -i $webdir/stat -x $scriptsdir/rrd-release-freeze-dates # do not run show-new and other stuff in parallel LOCKFILE="$lockdir/unchecked.lock" +cleanup() { + rm -f "${LOCKFILE}" +} + if lockfile -r16 $LOCKFILE 2> /dev/null; then - dak show-new > /dev/null - rm -f $LOCKFILE + trap cleanup EXIT + do_new + dak show-new > /dev/null || true + cleanup + trap - EXIT fi +dak queue-report -n > $webdir/new.html +dak queue-report -n -d backports-new > ${webdir}/backports-new.html +dak queue-report -8 -d new,byhand,stable-new,oldstable-new -r $webdir/stat +sudo -u dak-unpriv dak show-deferred -r $webdir/stat > ${webdir}/deferred.html +dak graph -n new,byhand,stable-new,oldstable-new,deferred -r $webdir/stat -i $webdir/stat -x $scriptsdir/rrd-release-freeze-dates + cd $webdir cat removals-20*.txt > removals-full.txt cat removals.txt >> removals-full.txt @@ -30,7 +47,37 @@ cat removals.822 >> removals-full.822 $base/dak/tools/queue_rss.py -q $queuedir/new -o $webdir/rss/ -d $base/misc -l $base/log/ $base/dak/tools/removals.pl $configdir/removalsrss.rc > $webdir/rss/removals.rss + # Tell ries to sync its tree -ssh -o Batchmode=yes -o ConnectTimeout=30 -o SetupTimeout=30 -2 -i ${base}/s3kr1t/pushddmirror dak@ries.debian.org sync +${scriptsdir}/sync-dd ries-sync ries-sync1 ries-sync2 sync $scriptsdir/generate-di + +# Push files over to security +#pg_dump -a -F p -t files | sed -e "s,^COPY files (,DELETE FROM external_files; COPY external_files (," | xz -3 | \ +# ssh -o BatchMode=yes -o ConnectTimeout=30 -o SetupTimeout=30 -2 -i ${base}/s3kr1t/push-external_files dak@wherever sync +# +# The key should run the following command: +# 'xzcat | pg_restore -1 -a' + +# Update backports ACL +sudo -u dak-unpriv cat /srv/backports-master.debian.org/etc/acl \ + | dak acl set-fingerprints backports \ + | mail -a "X-Debian: DAK" -e -s "backports: acl changes" backports-team@debian.org -- -F "Debian FTP Masters" -f ftpmaster@ftp-master.debian.org + +# do the buildd key updates +BUILDDFUN=$(mktemp -p "${TMPDIR}" BUILDDFUN.XXXXXX) +exec >> "${BUILDDFUN}" 2>&1 +${scriptsdir}/buildd-remove-keys +${scriptsdir}/buildd-add-keys +${scriptsdir}/buildd-prepare-dir + +for keyring in $(dak admin k list-binary); do + dak import-keyring --generate-users "%s" ${keyring} +done +exec >>/dev/null 2>&1 + +DATE=$(date -Is) +cat "${BUILDDFUN}" | mail -a "X-Debian: DAK" -e -s "[$(hostname -s)] Buildd key changes ${DATE}" buildd-keys@ftp-master.debian.org -- -F "Debian FTP Masters" -f ftpmaster@ftp-master.debian.org + +rm -f "${BUILDDFUN}"