Re: Make "exp" be quiet

From: Radoulov, Dimitre <cichomitiko_at_gmail.com>
Date: Tue, 26 Feb 2008 11:10:59 +0100
Message-ID: <47c3e5b2$0$90270$14726298@news.sunsite.dk>


Michael Schmarck wrote:
[...]
> I'm using exp daily in a cron job to export data from a database.
> In the cron job, I'm running:
>
> exp ${ora_user}/${ora_pass} FILE=/tmp/test.exp LOG=/tmp/test.exp.log \
> DIRECT=Y FULL=Y STATISTICS=NONE > /dev/null
>
> But despite the "> /dev/null", exp writes something on the terminal.
[...]
> How can I make "exp" shut up and only "say" something, when there's
> an error? The problem with exp not being quiet is, that this produces
> output and thus an email is triggered - I'd rather only get an email,
> if there's an error.

Something like this:

{ exp $ora_user/$ora_pass FILE=/tmp/test.exp LOG=/tmp/test.exp.log \ DIRECT=Y FULL=Y STATISTICS=NONE&&\
fgrep "without warnings" /tmp/test.exp.log ;}>/dev/null 2>&1||\ echo "An error occurred"|mailx -s "Yous subject" your_at_address

Regards
Dimitre Received on Tue Feb 26 2008 - 04:10:59 CST

Original text of this message