monthly.functions 951 B

1234567891011121314151617181920212223242526272829303132333435
  1. # -*- mode:sh -*-
  2. function rotatelog() {
  3. cd ${base}/log
  4. touch ${DATE}
  5. ln -sf ${DATE} current
  6. chmod g+w ${DATE}
  7. chown dak:ftpteam ${DATE}
  8. xz -9 ${OLDDATE}
  9. }
  10. function rotatequeued() {
  11. cd /srv/upload.debian.org/queued
  12. sudo -u dak-unpriv /srv/upload.debian.org/queued/debianqueued -k || true
  13. mv run/log log.${OLDDATE}
  14. sudo -u dak-unpriv touch run/log
  15. xz -9 log.${OLDDATE}
  16. sudo -u dak-unpriv /srv/upload.debian.org/queued/debianqueued 2>/dev/null
  17. }
  18. function archivequeuedone() {
  19. log "Archiving queue/done files of ${DONEYEAR}-${DONEMONTH}"
  20. cd ${queuedir}/done/${DONEYEAR}
  21. tar --create --xz --remove-files --file ${DONEMONTH}.tar.xz ${DONEMONTH}
  22. }
  23. function rotatereports() {
  24. for dir in ${queuedir}/{.,p-u-new,o-p-u-new} /srv/backports-master.debian.org/queue/policy; do
  25. cd ${dir}
  26. mv REPORT REPORT.${OLDDATE}
  27. touch REPORT
  28. xz -9 REPORT.${OLDDATE}
  29. done
  30. }