X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fdebian%2Fcron.dinstall;h=332aa036f551132ec85db9ece6e2144d496ed8c9;hb=35cd0972b5e14dc8727403e13fccd30776f3ae02;hp=599a96d4fd2f464df4bd36ecb583dc6d74caa825;hpb=a650ca814d48fbe72cde347828d405e5da780b80;p=dak.git diff --git a/config/debian/cron.dinstall b/config/debian/cron.dinstall index 599a96d4..332aa036 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() { @@ -222,7 +222,7 @@ function release() { function dakcleanup() { log "Cleanup old packages/files" - dak clean-suites + dak clean-suites -m 10000 dak clean-queues } @@ -235,6 +235,13 @@ 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" + STAMP=$(date "+%Y%m%d%H%M") + make_buildd_dir +} + function scripts() { log "Running various scripts from $scriptsdir" cd $scriptsdir @@ -262,6 +269,12 @@ function expire() { $scriptsdir/expire_dumps -d . -p -f "dump_*" } +function transitionsclean() { + log "Removing out of date transitions..." + cd $base + dak transitions -c -a +} + function reports() { # Send a report on NEW/BYHAND packages log "Nagging ftpteam about NEW/BYHAND packages" @@ -285,8 +298,16 @@ function bts() { function merkel2() { # Push dak@merkel so it syncs the projectb there. Returns immediately, the sync runs detached - log "Trigger merkels projectb sync" + log "Trigger merkel/flotows projectb sync" ssh -2 -o BatchMode=yes -o SetupTimeOut=30 -o ConnectTimeout=30 -i ~/.ssh/push_merkel_projectb dak@merkel.debian.org sleep 1 + # Also trigger flotow, the ftpmaster test box + ssh -2 -o BatchMode=yes -o SetupTimeOut=30 -o ConnectTimeout=30 -i ~/.ssh/push_flotow_projectb dak@flotow.debconf.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() { @@ -318,6 +339,8 @@ function stats() { cd $configdir $scriptsdir/update-ftpstats $base/log/* > $base/misc/ftpstats.data R --slave --vanilla < $base/misc/ftpstats.R + dak stats arch-space > $webdir/arch-space + dak stats pkg-nums > $webdir/pkg-nums } function aptftpcleanup() { @@ -329,11 +352,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 +602,14 @@ GO=( ) stage $GO +GO=( + FUNC="buildd_dir" + TIME="buildd_dir" + ARGS="" + ERR="false" +) +stage $GO + GO=( FUNC="cruft" TIME="cruft" @@ -691,16 +730,16 @@ GO=( stage $GO GO=( - FUNC="pgdakdev" - TIME="dak-dev db" + FUNC="expire" + TIME="expire_dumps" ARGS="" - ERR="false" + ERR="" ) stage $GO GO=( - FUNC="expire" - TIME="expire_dumps" + FUNC="transitionsclean" + TIME="transitionsclean" ARGS="" ERR="" ) @@ -738,8 +777,6 @@ GO=( ) stage $GO -ulimit -m 90000 -d 90000 -s 10000 -v 200000 - GO=( FUNC="runparts" TIME="run-parts" @@ -770,14 +807,31 @@ GO=( ARGS="" ERR="false" ) +stage $GO rm -f ${LOCK_BRITNEY} +GO=( + FUNC="pgdakdev" + TIME="dak-dev db" + ARGS="" + ERR="false" +) +stage $GO + GO=( FUNC="aptftpcleanup" TIME="apt-ftparchive cleanup" ARGS="" - ERR="" + ERR="false" +) +stage $GO + +GO=( + FUNC="merkel3" + TIME="merkel ddaccessible sync" + ARGS="" + ERR="false" ) stage $GO