- 论坛徽章:
- 0
|
Scripts must be located in netbackup\bin and have the naming convention:
bpstart_notify.your_policy_name.specific_schedule_name.bat
bpend_notify.your_policy_name.specific_schedule_name.bat
The specific_schedule_name does not need to be there.
For example:
bpstart_notify.loc1_server1_nt.bat
@REM this script is called by NetBackup when a backup is initiated
@REM this script:
@REM receives 4 parameters, clientname, classname, schedname and schedtype
@REM must be executable by a user with Administrator rights
@REM should exit with 0 upon successful completion
@REM
@REM If this script will not complete within a few seconds, you should set
@REM the BPSTART_TIMEOUT in the NetBackup configuration gui on the server.
@REM You should also be aware that the time taken by this script will delay
@REM the initiation of other client's backups.
@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 - HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions
@REM -
@REM - It should be set to 0x1 or you may have problems running this script.
@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="d:\srvapps\veritas\backupresults\bpstart_notify.loc1_server1_nt.txt"
@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
@echo "This is a start_notify script" > %OUTF%
@REM
@REM Unremark the following line and add you batch file, command file etc.
net stop "nai epolicy orchestrator agent" >> %OUTF%
net stop "network associates mcshield" >> %OUTF%
net stop "network associates alert manager" >> %OUTF%
And...
bpend_notify.loc1_server1_nt.bat
@@REM this script is called by NetBackup when a backup has completed
@REM
@REM this script:
@REM receives 5 parameters,
@REM CLIENTNAME, CLASSNAME, SCHEDNAME, SCHEDTYPE and STATUS
@REM must be executable by a user with Administrator rights
@REM should exit with 0 upon successful completion
@REM
@REM If this script will not complete within a few seconds, you should set
@REM the BPSTART_TIMEOUT in the NetBackup configuration gui on the server.
@REM You should also be aware that the time taken by this script will delay
@REM the initiation of other client's backups.
@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 - HKEY_CURRENT_USER\Software\Microsoft\CommandProcessor\EnableExtensions
@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="d:\srvapps\veritas\backupresults\bpend_notify.loc1_server1_nt.txt"
@REM
@REM - Get date and time.
@for /F "tokens=1*" %%p in ('date /T') do @set DATE=%%p %%q
@for /F %%p in ('time /T') do @set DATE=%DATE% %%p
@ECHO "This is an end notify script" > %OUTF%
@REM unremark the following line and call your command file, batch file etc...
net start "network associates mcshield" >> %OUTF%
net start "nai epolicy orchestrator agent" >> %OUTF%
net start "network associates alert manager" >> %OUTF%
If you found this useful, please mark it as such so that others can benefit. |
|