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
+}
rotatelog none none false true
rotatequeued none none false true
archivequeuedone none none false true
+rotatereports none none false true