cancel
Showing results for 
Search instead for 
Did you mean: 

Script that runs before and after a Job, seems to run after a child job finishes

contra04
Level 5

Hello people. Windows server 2003, Netback7, client is Windows 2008

 

I have a policy Job that spawns 3 child jobs that does a full Back up an H:\ a G:\ and an F:\

Backup Window is 9PM friday to midnight Sunday

There is a bpstart_notify.grub-bak_san.bat and a bpend_notify.grub-bak_san.bat that is configured on this server.

The bpstart_notify.grub-bak_san.bat calls a powersheel script that maps H:\ G:\ F:\ as LOCAL drives. (they are conencted SAN volumes).

bpend_notify.grub-bak_san.bat calls a powershell script that Unmaps the H:\, G:\ and F:\

 

Now the backup job begins with the parent job, calls the script then spawns 3 child jobs, one for each Drive on the server, as expected.

Only the H:\ (first in the list) starts as we are tight on the tape resource in the weekend.

After a day and a half and 332 gigabytes, the H:\ Finishes and frees the resource.

 

Then when the G:\ child job tries to start and complains that it cannot find the files specified.  The Drives have already been unmapped.  My question is why is the bpend_notify.mypolicy.bat being called at the end of the child job, rather than the end of the whole Job ? the start window is still valid?

The same is true for the F:\ Job:

F:\

08/07/2011 21:00:29 - requesting resource Quantum-PX502
08/07/2011 21:00:29 - requesting resource harry.NBU_CLIENT.MAXJOBS.grub-bak
08/07/2011 21:00:29 - requesting resource harry.NBU_POLICY.MAXJOBS.grub-bak_san
08/07/2011 21:00:29 - Info nbrb(pid=8464) Limit has been reached for the logical resource harry.NBU_CLIENT.MAXJOBS.grub-bak    
10/07/2011 05:17:26 - granted resource harry.NBU_CLIENT.MAXJOBS.grub-bak
10/07/2011 05:17:26 - granted resource harry.NBU_POLICY.MAXJOBS.grub-bak_san
10/07/2011 05:17:26 - granted resource ASI282
10/07/2011 05:17:26 - granted resource HP.Ultrium3-SCSI.001
10/07/2011 05:17:26 - granted resource Quantum-PX502
10/07/2011 05:17:26 - estimated 0 Kbytes needed
10/07/2011 05:17:40 - connecting
10/07/2011 05:17:42 - connected; connect time: 00:00:02
10/07/2011 05:17:42 - begin writing
10/07/2011 05:20:47 - end writing; write time: 00:03:05
none of the files in the file list exist(71)

 

Successful H:\

08/07/2011 21:00:29 - estimated 0 Kbytes needed
08/07/2011 21:00:29 - started process bpbrm (9904)
08/07/2011 21:00:38 - mounting LFT888
08/07/2011 21:00:40 - connecting
08/07/2011 21:00:41 - connected; connect time: 00:00:01
08/07/2011 21:01:17 - mounted; mount time: 00:00:39
08/07/2011 21:01:22 - positioning LFT888 to file 71
08/07/2011 21:02:50 - positioned LFT888; position time: 00:01:28
08/07/2011 21:02:50 - begin writing
09/07/2011 00:23:28 - current media LFT888 complete, requesting next resource Any
09/07/2011 00:23:28 - current media -- complete, awaiting next media Any Reason: Drives are in use, Media Server: harry,
     Robot Number: 0, Robot Type: TLD, Media ID: N/A, Drive Name: N/A,
     Volume Pool: Weekly, Storage Unit: Quantum-PX502, Drive Scan Host: N/A
...............
10/07/2011 03:30:40 - granted resource ASI283
10/07/2011 03:30:40 - granted resource HP.Ultrium3-SCSI.000
10/07/2011 03:30:40 - granted resource Quantum-PX502
10/07/2011 03:30:42 - mounting ASI283
10/07/2011 03:31:38 - mounted; mount time: 00:00:56
10/07/2011 03:31:43 - positioning ASI283 to file 1
10/07/2011 03:31:47 - positioned ASI283; position time: 00:00:04
10/07/2011 03:31:47 - begin writing
10/07/2011 05:17:25 - end writing; write time: 01:45:38
the requested operation was partially successful(1)

The job was successfully completed, but some files may have been
busy or unaccessible. See the problems report or the client's logs for more details.

 

F:\ - the same:

 

08/07/2011 21:00:29 - requesting resource Quantum-PX502
08/07/2011 21:00:29 - requesting resource harry.NBU_CLIENT.MAXJOBS.grub-bak
08/07/2011 21:00:29 - requesting resource harry.NBU_POLICY.MAXJOBS.grub-bak_san
08/07/2011 21:00:29 - Info nbrb(pid=8464) Limit has been reached for the logical resource harry.NBU_CLIENT.MAXJOBS.grub-bak    
10/07/2011 05:20:47 - granted resource harry.NBU_CLIENT.MAXJOBS.grub-bak
10/07/2011 05:20:47 - granted resource harry.NBU_POLICY.MAXJOBS.grub-bak_san
10/07/2011 05:20:47 - granted resource ASI282
10/07/2011 05:20:47 - granted resource HP.Ultrium3-SCSI.001
10/07/2011 05:20:47 - granted resource Quantum-PX502
10/07/2011 05:20:48 - estimated 0 Kbytes needed
10/07/2011 05:20:57 - connecting
10/07/2011 05:20:59 - connected; connect time: 00:00:02
10/07/2011 05:20:59 - begin writing
10/07/2011 05:23:38 - end writing; write time: 00:02:39
none of the files in the file list exist(71)

It then tried 3 more times up until 19:08 last night for G:\ anf F:\ all failing with (71)

any ideas?

5 REPLIES 5

Andy_Welburn
Level 6

as the scripts run at the start/end of each stream - you'll have to do some clever scripting within these to ensure they only run at the start of the first stream & then the end of the last (or look at parent_start_notify, but that runs on the master!)

Implementing the NetBackup bpstart_notify and the bpend_notify scripts when using Multistreaming in the backup policy
http://www.symantec.com/business/support/index?page=content&id=TECH69986

RiaanBadenhorst
Moderator
Moderator
Partner    VIP    Accredited Certified

You can look at parent_start_notify and parent_end_notify scripts which are located on the master. You'll have to modify them so they only execute for your specific backups (add IF logic), and assuming your powershell scripts can remote execute.

 

Or change the "Allow multiple data stream' option as suggested by Andy.

contra04
Level 5

Thanks very much for the replies guys - I have found some logic in the script that keeps track of a variable that will only unmap when it reaches 0.

So to get this straight:

 

The start script runs at the beginning of every Child backup job - it then backs up the drive e.g. H:\ then proceeds to run the end script.  Hopefully the end script doesnt unmap as it is keeping hold of a value that gets it to exit before unmapping if a variable does not equate to "all drives" backed up. 

 

It then goes onto the next child job, runs the start again, backs up, then runs the end again etc..

 

I think we need to move the logic out of the powershell script and into the bp_start notify suing what was recommended on that excellent page you sent me.  Thank you very much

 

 

 

contra04
Level 5

Hmm sorry to drag this one up again - Just to confirm

but If a child job fails due to the drives not being mapped in time, it will run bpend_notify, then 15 minutes later (or whatever the retry timer is set to) start the same child job again - as a new job number and run bpstart_notify again.....

 

Any way to not get the parent job to check that the Drives and files exist, and let the children do that?? as the drive mapping is done by my bpstart.....?

contra04
Level 5

anyone know if what I said happens? as in when a job fails, it runs the bpend_ then 15 mins later when it retries - that is runs th start again ?