cancel
Showing results for 
Search instead for 
Did you mean: 

Notification only when backup fails

iwannabfishn
Level 2
I am using Netbackup 6.5 with Blat to send out backup notifications. I don't want to know if the backup succeeds or partially succeeds. I only want to know when it fails. I am not a scripting guy and I am having trouble finding a "how to" on this exact issue. I find lots of information on how to setup the notification, but not on how to only get some of them. My current backup_exit_notify.cmd script is below. Any help would be appreciated. Thanks! @REM @REM $Header: backup_exit_notify.cmd,v 1.2 2002/11/20 02:10:34 $ @REM @REM bcpyrght @REM *************************************************************************** @REM * $VRTScprght: Copyright 1993 - 2007 Symantec Corporation, All Rights Reserved $ * @REM *************************************************************************** @REM ecpyrght @REM @REM backup_exit_notify.cmd @REM @REM This script is called by the NetBackup scheduler, after an individual @REM client backup has completed (including media closure and image db @REM validation. @REM @REM NOTE: this script will always be run in "background" mode, meaning that @REM the NetBackup scheduler will NOT wait for it's completion. @REM @REM This script: @REM receives 5 parameters: @REM %1 = CLIENT - the client hostname @REM %2 = POLICY - the policy label @REM %3 = SCHEDULE - the schedule label @REM %4 = SCHEDULE_TYPE - the type of schedule: FULL INCR UBAK @REM UARC @REM %5 = STATUS - the backup status for this job @REM %6 = STREAM - the backup stream number for this job @REM @REM - Main program ------------------------------------------------------------ @REM - @REM - This script only runs on NT 4.0 and succeeding versions of NT. You must @REM - have command extensions enabled. Check the following registry entry: @REM - @REM - HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions @REM - @REM - It should be set to 0x1 or you may have problems running this script. @REM --------------------------------------------------------------------------- @setlocal ENABLEEXTENSIONS @set LISTPATHS="%~dp0\goodies\listpaths" @for /F "delims=|" %%p in ('%LISTPATHS% /s NB_MAIL_SCRIPT') do @set NB_MAIL_SCRIPT="%%p" @set OUTF="%~dp0\BACKUP_EXIT_CALLED" @REM --------------------------------------------------------------------------- @REM - Get date and time. @REM --------------------------------------------------------------------------- @for /F "tokens=1*" %%p in ('date /T') do @set DATE=%%p %%q @for /F %%p in ('time /T') do @set DATE=%DATE% %%p @REM --------------------------------------------------------------------------- @REM - Check for proper parameter use. @REM --------------------------------------------------------------------------- @if "%6" == "" goto BadParams @if "%7" == "" goto GoodParams :BadParams @echo %DATE% backup_exit_notify expects 6 parameters: %* >> %OUTF% @goto EndMain :GoodParams @REM --------------------------------------------------------------------------- @REM - You may want to delete the output file elsewhere in order to @REM - accumulate successful backup information. If so, delete the @REM - following line or move it to where it will do the most good. @REM --------------------------------------------------------------------------- @if "%5" == "1" goto :EndMain @if "%5" == "2" goto :EndMain @if exist %OUTF% del %OUTF% @REM --------------------------------------------------------------------------- @echo %DATE% ----------------------------- >> %OUTF% @echo %DATE% CLIENT: %1 >> %OUTF% @echo %DATE% POLICY: %2 >> %OUTF% @echo %DATE% SCHEDULE: %3 >> %OUTF% @echo %DATE% SCHEDULE TYPE: %4 >> %OUTF% @echo %DATE% STATUS: %5 >> %OUTF% @echo %DATE% STREAM: %6 >> %OUTF% @echo %DATE% ----------------------------- >> %OUTF% @REM --------------------------------------------------------------------------- @REM - might want to mail this info to someone @REM - @REM - @call %NB_MAIL_SCRIPT% someone_who_cares "NetBackup backup exit" %OUTF% @REM --------------------------------------------------------------------------- :EndMain @endlocal @REM - End of Main Program -----------------------------------------------------
2 REPLIES 2

Will_Restore
Level 6
so I would change the lines

@if "%5" == "1" goto :EndMain
@if "%5" == "2" goto :EndMain

to

@if "%5" == "0" goto :EndMain
@REM exit if success
@if "%5" == "1" goto :EndMain
@REM exit if partial success

.

and remove "@REM - " from the following

@REM - @call %NB_MAIL_SCRIPT% someone_who_cares "NetBackup backup exit" %OUTF%

iwannabfishn
Level 2
I have made the changes and I am testing it. Thanks for the reply!