X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fdebian%2Fcron.dinstall;h=d5776af147aadc9d327d91bfceb613a19bc5fce1;hb=425e44739cd77ffa01294f23e94ae7eabd5f5ec8;hp=9c9840d7c45e27213cedf62a65d7e44e443fdb0d;hpb=db8a8b7d0405de68ee91af73286a0ba33a40b59b;p=dak.git diff --git a/config/debian/cron.dinstall b/config/debian/cron.dinstall index 9c9840d7..d5776af1 100755 --- a/config/debian/cron.dinstall +++ b/config/debian/cron.dinstall @@ -74,7 +74,7 @@ function merkel1() { # Create the postgres dump files function pgdump_pre() { log "Creating pre-daily-cron-job backup of projectb database..." - pg_dump projectb > $base/backup/dump_$(date +%Y.%m.%d-%H:%M:%S) + pg_dump projectb > $base/backup/dump_pre_$(date +%Y.%m.%d-%H:%M:%S) } function pgdump_post() { @@ -235,6 +235,12 @@ function buildd() { apt-ftparchive generate apt.conf.buildd } +function buildd_dir() { + # Rebuilt the buildd dir to avoid long times of 403 + log "Regenerating the buildd incoming dir" + make_buildd_dir +} + function scripts() { log "Running various scripts from $scriptsdir" cd $scriptsdir @@ -289,6 +295,12 @@ function merkel2() { ssh -2 -o BatchMode=yes -o SetupTimeOut=30 -o ConnectTimeout=30 -i ~/.ssh/push_merkel_projectb dak@merkel.debian.org sleep 1 } +function merkel3() { + # Push dak@merkel to tell it to sync the dd accessible parts. Returns immediately, the sync runs detached + log "Trigger merkels dd accessible parts sync" + ssh -2 -o BatchMode=yes -o SetupTimeOut=30 -o ConnectTimeout=30 -i ~/.ssh/push_merkel_ddaccess dak@merkel.debian.org sleep 1 +} + function runparts() { log "Using run-parts to run scripts in $base/scripts/distmnt" run-parts --report $base/scripts/distmnt @@ -329,11 +341,19 @@ function aptftpcleanup() { function compress() { log "Compress old psql backups" cd $base/backup/ - find -maxdepth 1 -mindepth 1 -type f -name 'dump_*' \! -name '*.bz2' \! -name '*.gz' -mtime +1 | + find -maxdepth 1 -mindepth 1 -type f -name 'dump_pre_*' -mtime +2 -print0 | xargs -0 --no-run-if-empty rm + + find -maxdepth 1 -mindepth 1 -type f -name 'dump_*' \! -name '*.bz2' \! -name '*.gz' -mmin 720 | while read dumpname; do echo "Compressing $dumpname" bzip2 -9v "$dumpname" done + find -maxdepth 1 -mindepth 1 -type f -name "dumpall_*" \! -name '*.bz2' \! -name '*.gz' -mmin 720 | + while read dumpname; do + echo "Compressing $dumpname" + bzip2 -9v "$dumpname" + done + finddup -l -d $base/backup } function logstats() { @@ -571,6 +591,14 @@ GO=( ) stage $GO +GO=( + FUNC="buildd_dir" + TIME="buildd_dir" + ARGS="" + ERR="false" +) +stage $GO + GO=( FUNC="cruft" TIME="cruft" @@ -780,6 +808,14 @@ GO=( ) stage $GO +GO=( + FUNC="merkel3" + TIME="merkel ddaccessible sync" + ARGS="" + ERR="false" +) +stage $GO + GO=( FUNC="compress" TIME="compress"