Sponsored Content
Full Discussion: Help me in finding logic
Top Forums UNIX for Dummies Questions & Answers Help me in finding logic Post 302304528 by pen on Monday 6th of April 2009 05:20:39 PM
Old 04-06-2009
Hi!

Perhaps you are thinking in a too complicated way? If I understood your problem correctly, main thing is to receive e-mail in case of an error, not for collecting statistics every 10 minutes?

Why wouldn't you just do something like

tail -f message_log_file | \
awk '/OOM/ { printf "OOM" }
/JAM/ { printf "JAM" } ' | while read LINE
do
# and the mailing part comes here
done

(Or even faster, use sed's regexps).

I haven't tested that, but it should work - and is LOTS lighter than polling the last 2000 lines of a file. Plus, this informs you instantly (well, one second after the file is changed, to be precise).

Regards,

pen
 

We Also Found This Discussion For You

1. Shell Programming and Scripting

finding duplicate files by size and finding pattern matching and its count

Hi, I have a challenging task,in which i have to find the duplicate files by its name and size,then i need to take anyone of the file.Then i need to open the file and find for more than one pattern and count of that pattern. Note:These are the samples of two files,but i can have more... (2 Replies)
Discussion started by: jerome Sukumar
2 Replies
All times are GMT -4. The time now is 08:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy