[Piuparts-commits] [SCM] piatti.debian.org configuration files branch, piatti, updated. 487d249d7545c5cd5b28a402706a1f69ac0c5ace

Holger Levsen holger at layer-acht.org
Wed Dec 21 15:25:04 UTC 2011


The following commit has been merged in the piatti branch:
commit de3613bb9bd2b5fc8412162e89a9499ca1ed32a0
Author: Holger Levsen <holger at layer-acht.org>
Date:   Wed Dec 21 16:10:18 2011 +0100

    only send mail if there is output

diff --git a/home/piupartsm/bin/generate_daily_report b/home/piupartsm/bin/generate_daily_report
index 8394628..6555b6a 100755
--- a/home/piupartsm/bin/generate_daily_report
+++ b/home/piupartsm/bin/generate_daily_report
@@ -54,9 +54,14 @@ 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 ; do
-  ~/bin/$SCRIPT 2>&1 | mail -s $SCRIPT $LOGNAME
+  ~/bin/$SCRIPT 2>&1 > $OUTPUT
+  if [ -s $OUTPUT ] ; then 
+	cat $OUTPUT | mail -s $SCRIPT $LOGNAME
+  fi
 done
+rm $OUTPUT
 
 #
 # piuparts-report starts here

-- 
piatti.debian.org configuration files



More information about the Piuparts-commits mailing list