Monitor log file thru shell script
Date: Tue, 8 Jul 2008 16:57:26 -0400
Message-ID: <1e52ad820807081357p1b660e4eqa51539db7d1d6127@mail.gmail.com>
Hello.
I am attempting to look for a pattern in the continuously growing log file
and mail me if match is found. (on Linux). But I am having problem.
This is the part of the shell script
export err1=down
tail -f testlogfile | egrep -n "${err1}" | mail -s "Found warning"
shivaswamykr_at_gmail.com
As you see I am using tail -f and egrep. When I run only tail -f & egrep
part on the prompt on my testlogfile, I am able to see the output from
egrep.
But when I pipe it to mail, and run it on nohup on a shell script, nothing
happens. I can see that mail process is in T state, meaning it is stopped.
If I kill my shell script running in the background, I get the email
notification, as expected.
What happens here? How I can get the notification, without killing the
process?
If you could please help, I appreciate it.
Thanks,
Shiva
-- http://www.freelists.org/webpage/oracle-lReceived on Tue Jul 08 2008 - 15:57:26 CDT