cancel
Showing results for 
Search instead for 
Did you mean: 

Email Alerting for failed jobs

sumanreddy
Level 4
Certified
Hi All,

I have configured email alerting for Backup jobs.
I am getting emails for both failed jobs , partial jobs and successful jobs.

where as i want to receive emails/alerts for ONLY failed jobs.
If  there is any possibilty let me know the ateps.

Thanks in advance,

Regards,
Suman
2 REPLIES 2

nairdheeraj
Level 4
All you need to do is to append the backup_exit_notify script with the below lines

if [ "$5" -gt 1 ]
then
        cat $OUTF | mailx -s "$2 - Exit Status = $5" abdcd@abcd.com


this is for unix environment.

Basically $5 is the exit status code. Hence by giving the above condition and error apart from "0" and "1" will be email to you.

You can use this syntax for other script files are well.