Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create bpstart_notify.bat and bpend_notify.bat scripts? 2

Status
Not open for further replies.

maureentc

MIS
Jul 3, 2002
2
0
0
US
I am in need of an example script for the bpstart_notify.bat
and bpend_notify.bat files for Windows NT.
If someone has an example of these scripts and would be
so kind as to post it in this forum, I would much appreciate it.

Thanks for your help.
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top