Path: ccsf.homeunix.org!ccsf.homeunix.org!news1.wakwak.com!nf1.xephion.ne.jp!onion.ish.org!gcd.org!vda-gw!news.moat.net!news.glorb.com!postnews.google.com!g14g2000cwa.googlegroups.com!not-for-mail From: joutlaw@gmail.com Newsgroups: fj.unix.shells Subject: UNIX scripting assistance Date: 21 Feb 2005 11:32:46 -0800 Organization: http://groups.google.com Lines: 31 Message-ID: <1109014366.562554.165890@g14g2000cwa.googlegroups.com> NNTP-Posting-Host: 63.97.162.236 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1109014370 2454 127.0.0.1 (21 Feb 2005 19:32:50 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 21 Feb 2005 19:32:50 +0000 (UTC) User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: g14g2000cwa.googlegroups.com; posting-host=63.97.162.236; posting-account=u6uW8g0AAABLrrqa54Jq-EFT49EZfQZ8 Xref: ccsf.homeunix.org fj.unix.shells:312 The script below reports errors in the RMAN logs by searching for the "RMAN-00571" text. I was hoping to get a simple script that greps for the text and if the text is not found then it will send an email to the DBALIST stating "All RMAN backups completed successfully". Thanks! #!/bin/ksh # # Report RMAN errors and send email to DBA - # export DBALIST=dba@test.com export date=`date` grep -i "RMAN-00571" /u002/LOG/*/* > /u002/LOG/RMAN_error.log mailx -s "${date} RMAN errors" $DBALIST < /u002/LOG/RMAN_error.log