[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] Rotate REPORT files



---
 config/debian/monthly.functions | 14 +++++++++++++-
 config/debian/monthly.tasks     |  1 +
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/config/debian/monthly.functions b/config/debian/monthly.functions
index db4de4b..738a3c8 100644
--- a/config/debian/monthly.functions
+++ b/config/debian/monthly.functions
@@ -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
+}
diff --git a/config/debian/monthly.tasks b/config/debian/monthly.tasks
index 6973142..cd06d6c 100644
--- a/config/debian/monthly.tasks
+++ b/config/debian/monthly.tasks
@@ -2,3 +2,4 @@
 rotatelog              none                       none                       false   true
 rotatequeued           none                       none                       false   true
 archivequeuedone       none                       none                       false   true
+rotatereports          none                       none                       false   true
-- 
2.1.4


Reply to: