From defe08d705776a51cadadb1aea6d88a04a91aa6e Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Tue, 10 Jan 2017 14:49:40 +0100 Subject: reproducible Debian: only include yesterdays problems when mailing postgres.log Signed-off-by: Holger Levsen --- bin/reproducible_maintenance.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bin/reproducible_maintenance.sh') diff --git a/bin/reproducible_maintenance.sh b/bin/reproducible_maintenance.sh index 8cfdabaf..c6e7c63a 100755 --- a/bin/reproducible_maintenance.sh +++ b/bin/reproducible_maintenance.sh @@ -420,8 +420,9 @@ if [ "$HOSTNAME" = "$MAINNODE" ] && [ $(date -u +%H) -eq 0 ] ; then # maybe we should use logrotate for our jenkins logs too… mv $PROBLEM $TMPFILE else - # regular logfile, logrotate is used (and the file aint owned by jenkins) - cp $PROBLEM $TMPFILE + # regular logfile, logrotate is used (and the file ain't owned by jenkins) + # only care for yesterday's entries: + grep $(date -u -d "1 day ago" '+%Y-%m-%d') $PROBLEM > $TMPFILE || echo "no problems yesterday…" > $TMPFILE fi ( if [ "$(basename $PROBLEM)" = "reproducible-diskspace-issues.log" ]; then echo "diskspace issues should always be investigated." -- cgit v1.2.3-70-g09d2