1828336 Members
3400 Online
109976 Solutions
New Discussion

cron errors to sendmail

 
SOLVED
Go to solution
p7
Frequent Advisor

cron errors to sendmail

hi all

we have a cron job that stops/starts oracle for data protector backup. sometimes oracle has errors and doesnt come up all the way. is
there a generic way to pass errors to sendmail
so the user knows if oracle is up or down?

thx in advance
1 REPLY 1
James R. Ferguson
Acclaimed Contributor
Solution

Re: cron errors to sendmail

Hi:

In any crontask, un-redirected STDOUT or STDERR is sent as mail to the initiating user.

Hence, in the absence of doing anything, any output will be mailed to the user that cron'ed the task.

If you want only STDERR, for example, do something like:

# /usr/local/bin/mything 1>/dev/null

In this case, STDOUT goes to the bit-bucket, but any STDERR gets mailed to the initiating user when the above task is 'cron'ed.

Regards!

...JRF...
Regards!

...JRF...