cancel
Showing results for 
Search instead for 
Did you mean: 

Wait for bpstart_notify.bat before backup job starts?

Pete_From_LTG
Level 3
Hello.  I want to run a snapshot script before a backup starts that I have verified works properly without any stdout.  My issue is that the script is re-snapping a volume on a remote server and the backup job will attempt to start before said script is finished.  I have even written in some old school batch 'waiting' in the bpstart_notify.bat to try to wait for it to complete.  Is there a way to make NetBackup wait for the scripts to finish before moving on?  Here is the code:

bpstart_notify.bat:


@REM main script starts here
@REM This is a simple script that records what kind of backup will be done along
@REM with other relevent information (Client name, policy name, etc) and 
@REM appends the information to the results file
@REM --------------------------------------------------------------------
@REM print a generic message since backup is neither full, nor cumulative incremental
@REM @echo backup/restore started on %1 using policy %2 with schedule %3 and status %5, bpres = %6 >> bin\BP_RES.txt
@REM @echo 0 >> %6
@call c:\scripts\snapDCC.bat >> %6
:loop
@if exist c:\scripts\dccSnap.done goto end
@ping 127.0.0.1 -n 5 -w 1000 > nul
@goto loop
:end
@del c:\scripts\dccSnap.done

The snap script looks like this (snapping with Sun's CAM software):


@call C:\scripts\Component\sscs\bin\sscs.bat login -h xxx -u xxx 
@echo login done >> c:\scripts\dcc.log
@call C:\scripts\Component\sscs\bin\sscs.bat modify -a xxx_array -R snapshot snap_xxx
@echo RD1 Mapped >> c:\scripts\dcc.log
@call C:\scripts\Component\sscs\bin\sscs.bat logout
@echo logged out >> c:\scripts\dcc.log
@ping -n 30 -w 1000 0.0.0.1 > NUL
@echo DONE >> c:\scripts\dccSnap.done

As I said, the scripts work perfectly, it is a timing issue of the actual backup of the data sometimes starts before the snap is complete.

 
1 ACCEPTED SOLUTION

Accepted Solutions

Marianne
Level 6
Partner    VIP    Accredited Certified
What happens if you run "c:\scripts\UNmountDccStore1Rdm1.vbs" from cmd?
Are you returned to the prompt immediately?
If that's the case, you need a 'sleep' in bpstart_notify, not in the script being called.

Extract from Admin Guide II:

If the.... bpstart_notify script exists, it runs in the foreground and the bpbkar process on the client waits for it to complete before continuing. Any commands in the script that do not end with an & character run serially.

The server expects the client to respond with a continue message within the time that the BPSTART_TIMEOUT option specifies on the server.

View solution in original post

6 REPLIES 6

MOHAMED_PATEL
Level 5
Partner Accredited Certified
increase the timeout on the master server -

host properties -> master server -> timeouts -> bpstart notify timeout
default is 300s
increase here

If you know more or less how long it takes for your snap to comlplete then increase to a bit more than that amount.

Pete_From_LTG
Level 3
The job starts after 2 to 2:30 after starting the job so I do not believe this is the issue (and the default timeout is 5 minutes).  Just to make sure we will set it to 10 minutes and re-run it.  Thanks for the suggestion.

Will_Restore
Level 6
no need for fancy wait loops!  here's my bpstart_notify script:

/usr/local/bin/start.snap

that's all there is to it!  netbackup will call start.snap and wait for successful return.
oh, and we set backup start notify timeout on the master server to 3600 seconds.

Pete_From_LTG
Level 3
OK, so we are going nuts.  I went simple to troubleshoot the problem.  Here is my bpstart_notify script:

c:\scripts\UNmountDccStore1Rdm1.vbs

Here is the c:\scripts\UNmountDccStore1Rdm1.vbs file:

WScript.sleep 60000

---------------------------------

The job starts and tries to backup data after 4 seconds.  It does not wait fir the 1 minute wscript.sleep command to finish.  I usually think I am not a moron but am starting to question that.  Please help.

Pete_From_LTG
Level 3
OK, so we are going nuts.  I went simple to troubleshoot the problem.  Here is my bpstart_notify script:

c:\scripts\UNmountDccStore1Rdm1.vbs

Here is the c:\scripts\UNmountDccStore1Rdm1.vbs file:

WScript.sleep 60000

---------------------------------

The job starts and tries to backup data after 4 seconds.  It does not wait for the 1 minute wscript.sleep command to finish.  I usually think I am not a moron but am starting to question that.  Please help.

Marianne
Level 6
Partner    VIP    Accredited Certified
What happens if you run "c:\scripts\UNmountDccStore1Rdm1.vbs" from cmd?
Are you returned to the prompt immediately?
If that's the case, you need a 'sleep' in bpstart_notify, not in the script being called.

Extract from Admin Guide II:

If the.... bpstart_notify script exists, it runs in the foreground and the bpbkar process on the client waits for it to complete before continuing. Any commands in the script that do not end with an & character run serially.

The server expects the client to respond with a continue message within the time that the BPSTART_TIMEOUT option specifies on the server.