Date: Wed, 26 Sep 2001 10:56:43 +1000 From: BSD Freak <bsd-freak@mbox.com.au> To: FreeBSD Questions <freebsd-questions@FreeBSD.ORG> Subject: if then statement with grep Message-ID: <9131a6912c7d.912c7d9131a6@mbox.com.au>
next in thread | raw e-mail | index | archive | help
Hiya all, This is probably a basic question for most of you, but I have been struggling finding any answers. I want to run a script from /etc/periodic/daily that will search a log file for a certain string and if if found it should send me an e-mail.. The logic should be as follows: if `grep "expected line" /var/log/mylogfile` does NOT return something then mail -s "Alert" me@mycompany.com otherwise don't bother me Thank you all --------------------------------------------------------------------- mBox is unified messaging and now has the mBeeper! Be the first to trial it. http://www.mbox.com.au/mbeeper To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9131a6912c7d.912c7d9131a6>