@REM @REM $Header: backup_exit_notify.cmd,v 1.4 2009/08/10 22:03:06 $ @REM @REM bcpyrght @REM *************************************************************************** @REM * $VRTScprght: Copyright 1993 - 2011 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 individua @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 7 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 %7 = DONE_TRYING - 0=will retry. 1=not retrying @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 "%7" == "" goto BadParams @if "%8" == "" goto GoodParams :BadParams @echo %DATE% backup_exit_notify expects 7 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 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% DONE_TRYING: %7 >> %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 -----------------------------------------------------