]> git.decadent.org.uk Git - dak.git/commitdiff
Rotate REPORT files
authorJoerg Jaspert <joerg@debian.org>
Thu, 31 Dec 2015 13:08:43 +0000 (14:08 +0100)
committerJoerg Jaspert <joerg@debian.org>
Thu, 31 Dec 2015 13:10:04 +0000 (14:10 +0100)
config/debian/monthly.functions
config/debian/monthly.tasks

index db4de4b85f3971cb4bb758add5261cec997df329..738a3c8f857ad4d2bdf8459936271cf3ce29033a 100644 (file)
@@ -22,4 +22,16 @@ 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
+}
+
+function rotatereports() {
+    # Do not rotate while it might receive data
+    if lockfile -r -1 ${LOCK_UNCHECKED} 2> /dev/null; then
+        for dir in ${queuedir}/{.,p-u-new,o-p-u-new} /srv/backports-master.debian.org/queue/policy; do
+            cd ${dir}
+            mv REPORT REPORT.${OLDDATE}
+            xz -9 REPORT.${OLDDATE}
+            touch REPORT
+        done
+    fi
+}
index 6973142093b22a98e72e79966a3cf5cffa2f4b13..cd06d6c3894f5ff524834375180484645fe45792 100644 (file)
@@ -2,3 +2,4 @@
 rotatelog              none                       none                       false   true
 rotatequeued           none                       none                       false   true
 archivequeuedone       none                       none                       false   true
+rotatereports          none                       none                       false   true