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 ...@@ -9,8 +9,12 @@ touch $MAILTEXT_FILE
# grep for various errors in logfile # grep for various errors in logfile
cat $COLLECTD_LOGFILE | grep -i "error" >> $MAILTEXT_FILE cat $COLLECTD_LOGFILE | grep -i "error" >> $MAILTEXT_FILE
# search for error in debug output # search for error in debug output (only for files not older than 1 day)
grep -i "error " /tmp/pika_debug/pika_* >> $MAILTEXT_FILE 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 #check size of mail file
FILESIZE=$(stat -c%s "$MAILTEXT_FILE") FILESIZE=$(stat -c%s "$MAILTEXT_FILE")
......
#!/bin/bash #!/bin/bash
sh /sw/taurus/tools/pika/daemon/logrotate/pika_mail_errors.sh
exit 0 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