X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fdebian%2Fmonthly.functions;h=738a3c8f857ad4d2bdf8459936271cf3ce29033a;hb=ddeee80a2f3389f89fb5ee1d7ecc5e36a68279d7;hp=db4de4b85f3971cb4bb758add5261cec997df329;hpb=b41fdd720777325f75f921711243e1620c254e3b;p=dak.git diff --git a/config/debian/monthly.functions b/config/debian/monthly.functions index db4de4b8..738a3c8f 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 +}