diff --git a/contrib/nightly/create_tarball.sh b/contrib/nightly/create_tarball.sh index 719a19a65c..3121e42329 100755 --- a/contrib/nightly/create_tarball.sh +++ b/contrib/nightly/create_tarball.sh @@ -22,6 +22,9 @@ debug= # do you want a success mail? want_success_mail=1 +# max length of logfile to send in an e-mail +max_log_len=50 + # how many snapshots to keep in the destdir? max_snapshots=5 @@ -45,7 +48,13 @@ send_error_mail() { rm -f "$outfile" touch "$outfile" for file in `/bin/ls $logdir/* | sort`; do - cat "$file" >> "$outfile" + len="`wc -l $file | awk '{ print $1}'`" + if test "`expr $len \> $max_log_len`" = "1"; then + echo "[... previous lines snipped ...]" >> "$outfile" + tail -$max_log_len "$file" >> "$outfile" + else + cat "$file" >> "$outfile" + fi done Mail -s "=== CREATE ERROR ===" "$email" < "$outfile" rm -f "$outfile"