[Piuparts-commits] [piuparts] 11/11: generate_daily_report: remove obsolete .html files after 30 days

Holger Levsen holger at moszumanska.debian.org
Fri Jan 23 12:18:05 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch develop
in repository piuparts.

commit 6275963391fd84b4e22b858ace262db0c52f0951
Author: Andreas Beckmann <anbe at debian.org>
Date:   Wed Jan 21 03:36:39 2015 +0100

    generate_daily_report: remove obsolete .html files after 30 days
    
    remove summary pages for retired maintainers and obsolete source packages
    after 30 days with no updates
    limit deletion to 500 files per run
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
 debian/changelog                    |  2 ++
 master-bin/generate_daily_report.in | 13 +++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index ad08772..9d86529 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,6 +17,8 @@ piuparts (0.63) UNRELEASED; urgency=medium
   * piuparts-slave.py:
     - Handle Ctrl-C while downloading Packages files and flush/unreserve, too.
     - Catch another exception that may happen while talking to the master.
+  * generate_daily_report: Remove obsolete .html files (e.g. summaries for
+    removed source packages or retired maintainers) after 30 days.
   * scripts/pre_remove_40_find_unowned_lib_links: Ignore /lib/ld-lsb.so.[123]
     links created by lsb-core.
   * scripts-no-usr-share-doc: Add exception for localepurge.
diff --git a/master-bin/generate_daily_report.in b/master-bin/generate_daily_report.in
index 003aa79..d6483e3 100755
--- a/master-bin/generate_daily_report.in
+++ b/master-bin/generate_daily_report.in
@@ -80,6 +80,19 @@ nice \
 	>> $DAILYREPORT 2>&1
 date >> $DAILYREPORT
 
+echo "" >> $DAILYREPORT
+date >> $DAILYREPORT
+echo "Expiring old .html files:" >> $DAILYREPORT
+find $HTDOCS -name '* *.html' -mtime +30 -ls -delete >> $DAILYREPORT
+expire=$(mktemp)
+find $HTDOCS -name '*.html' -mtime +30 | head -n 500 > $expire
+if [ -s $expire ]; then
+	ls -ld $(cat $expire) >> $DAILYREPORT
+	rm -f $(cat $expire) >> $DAILYREPORT
+fi
+rm $expire
+date >> $DAILYREPORT
+
 cat $DAILYREPORT | mail -s piuparts-report $LOGNAME
 
 mv $FAILURESTAMP.new $FAILURESTAMP

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git



More information about the Piuparts-commits mailing list