Commit 2586bd3b authored by fwinkler's avatar fwinkler

Modified email script.

Grep for errors for files not older than 1 day.
parent 76d597c9
......@@ -9,8 +9,12 @@ touch $MAILTEXT_FILE
# grep for various errors in logfile
cat $COLLECTD_LOGFILE | grep -i "error" >> $MAILTEXT_FILE
# search for error in debug output
grep -i "error " /tmp/pika_debug/pika_* >> $MAILTEXT_FILE
# search for error in debug output (only for files not older than 1 day)
files="$(find /tmp/pika_debug/pika_* -mtime -1)"
for file in "$files"
do
grep -i "error " $file >> $MAILTEXT_FILE
done
#check size of mail file
FILESIZE=$(stat -c%s "$MAILTEXT_FILE")
......
#!/bin/bash
sh /sw/taurus/tools/pika/daemon/logrotate/pika_mail_errors.sh
exit 0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment