1
1

No need for the entire output when the creation fails; let's try

sending the last 100 lines and see how that works out.

This commit was SVN r2255.
Этот коммит содержится в:
Jeff Squyres 2004-08-23 06:35:28 +00:00
родитель 885f2213fb
Коммит 6bdbb731b8

Просмотреть файл

@ -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"