[Piuparts-commits] [SCM] piatti.debian.org configuration files branch, piatti, updated. 0.42-15-gbd39fbc

Andreas Beckmann debian at abeckmann.de
Sat Jan 7 11:44:25 UTC 2012


The following commit has been merged in the piatti branch:
commit 6e5b7af271527323027d8288a1e042950a687e0b
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Fri Jan 6 15:57:41 2012 +0100

    use a time stamp file for the start of new failures
    
    a) don't miss some failures because 'one day ago' may be racy
    b) don't duplicate them if daily processing is run more than once
       per day
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/home/piupartsm/bin/generate_daily_report b/home/piupartsm/bin/generate_daily_report
index b0bf497..3db0fb7 100755
--- a/home/piupartsm/bin/generate_daily_report
+++ b/home/piupartsm/bin/generate_daily_report
@@ -53,7 +53,9 @@ if [ -e $LOCKFILE ]; then
 fi
 date > $LOCKFILE
 
+#
 # various scripts to detect issues and cleanup
+#
 OUTPUT=$(mktemp)
 for SCRIPT in detect_stale_mounts detect_tmp_cruft detect_piuparts_issues archive_old_logs report_newly_bugged_packages ; do
   ~/bin/$SCRIPT 2>&1 > $OUTPUT
@@ -70,17 +72,26 @@ DAILYREPORT=$HTDOCS/dailyreport.txt
 >$DAILYREPORT
 
 # Failures of the day it should be, the rest is boring.
+FAILURESTAMP=$HTDOCS/last-failure-report.stamp
+test -f $FAILURESTAMP || touch -d @0 $FAILURESTAMP  # start at the epoch
+touch $FAILURESTAMP.new  # for the next report
+
+echo "New failures:" >> $DAILYREPORT
 for SECTION in $SECTIONS ; do
-	find $MASTER/$SECTION/fail $MASTER/$SECTION/bugged $MASTER/$SECTION/untestable -type f -name '*.log' -mtime -1 -exec ls -rt1 {} \;
+	find $MASTER/$SECTION/fail $MASTER/$SECTION/bugged $MASTER/$SECTION/untestable \
+		-type f -name '*.log' -newer $FAILURESTAMP -exec ls -1 {} + 2>/dev/null
 done | sed s#^$MASTER#$URLBASE# >> $DAILYREPORT
 
+echo "" >> $DAILYREPORT
 date >> $DAILYREPORT
 ~/bin/detect_well_known_errors 2>&1 >> $DAILYREPORT
 
+echo "" >> $DAILYREPORT
 date >> $DAILYREPORT
 nice python $PIUPARTS_PREFIX/share/piuparts/piuparts-report 2>&1 >> $DAILYREPORT 2>&1
-
 date >> $DAILYREPORT
+
 cat $DAILYREPORT | mail -s piuparts-report $LOGNAME
 
+mv $FAILURESTAMP.new $FAILURESTAMP
 rm -f $LOCKFILE

-- 
piatti.debian.org configuration files



More information about the Piuparts-commits mailing list