From: Joerg Jaspert Date: Wed, 30 Dec 2015 22:55:36 +0000 (+0100) Subject: Archive queue/done in monthly cronjob X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=b41fdd720777325f75f921711243e1620c254e3b;p=dak.git Archive queue/done in monthly cronjob archive the directory from 2 months ago, leaving only the last month accessible directly --- diff --git a/config/debian/monthly.functions b/config/debian/monthly.functions index 0241a96d..db4de4b8 100644 --- a/config/debian/monthly.functions +++ b/config/debian/monthly.functions @@ -16,4 +16,10 @@ function rotatequeued() { sudo -u dak-unpriv touch run/log xz -9 log.${OLDDATE} sudo -u dak-unpriv /srv/upload.debian.org/queued/debianqueued 2>/dev/null +} + +function archivequeuedone() { + log "Archiving queue/done files of ${DONEYEAR}-${DONEMONTH}" + cd ${queuedir}/done/${DONEYEAR} + tar --create --xz --remove-files --file ${DONEMONTH}.tar.xz ${DONEMONTH} } \ No newline at end of file diff --git a/config/debian/monthly.tasks b/config/debian/monthly.tasks index 619f58b4..69731420 100644 --- a/config/debian/monthly.tasks +++ b/config/debian/monthly.tasks @@ -1,3 +1,4 @@ # FUNC ARGS TIME ERR BG rotatelog none none false true -rotatequeued none none false true \ No newline at end of file +rotatequeued none none false true +archivequeuedone none none false true diff --git a/config/debian/monthly.variables b/config/debian/monthly.variables index da3dd1be..5e1ea61a 100644 --- a/config/debian/monthly.variables +++ b/config/debian/monthly.variables @@ -1,3 +1,6 @@ # -*- mode:sh -*- DATE=$(date +%Y-%m) OLDDATE=$(date -d yesterday +%Y-%m) + +DONEYEAR=$(date -d '2 months ago' +%Y) +DONEMONTH=$(date -d '2 months ago' +%m) \ No newline at end of file