cancel
Showing results for 
Search instead for 
Did you mean: 

Schedule dependency in netbackup.

PARTHASARATHI_S
Level 3

Hi Experts,

How to create a dependency between 2 schedules in 2 separate policy in netbackup.

I have policy A and policy B. Both have 2 monthly full backup schedules. I want schedule in policy B will trigger , once schedule in policy A is complete every time.

1 ACCEPTED SOLUTION

Accepted Solutions

mph999
Level 6
Employee Accredited

@Nicolai:

You can't - Netbackup has no options to create dependencies : i am not fully agree to the statement, as we have other backup servers, where one policy trigger another policy.

 

Nicolai is correct, there is no built in method in NBU to run a scedule based on the outcome of another schedule.

It 'might' be possible using the *end scripts, but this is a 'custom' method (eg. you have to manually write the script) as opposed to a built in function or feature.

 

View solution in original post

19 REPLIES 19

Nicolai
Moderator
Moderator
Partner    VIP   

You can't - Netbackup has no options to create dependencies.

But if you can explain the requirement, the community may have a workaround.

Please remember that incremental and full backup schedules for the same clients  must be in the same policy. A incremental must have a full backup as a reference, and that only happen within the same policy.

Marianne
Level 6
Partner    VIP    Accredited Certified

I agree with Nicolai.

What is the difference between policy A and B?

Are they backing up same or different data?

revarooo
Level 6
Employee

Easy to launch a backup based on a policy and schedule finishing, use the bpend_notify scripts to launch the second policy/schedule backup once the first has finished

 

http://www.veritas.com/docs/000082863

 

Marianne
Level 6
Partner    VIP    Accredited Certified

No that easy....

bpend_notify run on the client.

Client can only kick off user-type backup, not manual backup of Full/incremental schedule type.

revarooo
Level 6
Employee

I must admit, I've never tried it.

The other option is to put a script on the Master in cron or the scheduler (If Windows) and run backups one after the other and do away with scheduling via nbpem. That way policy 2 and the defining schedule always attempts to run after policy 1

 

 

sdo
Moderator
Moderator
Partner    VIP    Certified

You may be able to use "backup_exit_notify" on the master to detect successful completion of specifically client1 in policyA, and because it is on the master it would have the necessary environment and privileges to submit another backup of client1 via policyB.

revarooo
Level 6
Employee

aha maybe that was the one in the back of my head! :)

PARTHASARATHI_S
Level 3

First of all what a wonderful community, and beautiful answers. Thanks gentlemen .

I have done one thing now, i have done some modification to parent_end_notify script.

And there i have put the name of policy A, and done a

/usr/openv/netbackup/bin/bpbackup -p ${POLICY_NAME} -i

 

*POLICY_NAME=policy_B

to manually trigger policyB.

 

Am i missing something guys?

Will my policy -B trigger on this sunday monthly backup?

Marianne
Level 6
Partner    VIP    Accredited Certified
We cannot say. You have not given enough info about changes to parent_end_notify script. You also have not answered any of our questions.

PARTHASARATHI_S
Level 3

@Nicolai:

You can't - Netbackup has no options to create dependencies : i am not fully agree to the statement, as we have other backup servers, where one policy trigger another policy.

@Marianne:

They are separate policy for same client with separate backup selection.

@revarooo:

Policy:A has multiple streams, i guess bpend_notify runs after every streams, so it may not be a viable solution. Also as per Marianne, bpend_notify runs in client end. But @revarooo,  netbackup should have some scripts like parent_end_notify in /usr/openv/netbackup/bin

@sdo: can i use backup_exit_notify to edit it directly? Can you please tell me if the script is called by a backup process, like end of parent job or something. Is it any way different than parent_end_notify ? Thanks for your suggestion

Mark_Solutions
Level 6
Partner Accredited Certified

If you have it working on other backup servers then copy the process that they use.

If it is the same client with multiple streams why not just put all streams into one policy and limit the number of jobs that it can run - would that not be suitable .. if you set the stream order and numbers used you should be able to acheive what you want?

 

sdo
Moderator
Moderator
Partner    VIP    Certified
It's called at the end of all backup jobs - you need put some IF logic in it.

sdo
Moderator
Moderator
Partner    VIP    Certified

I can't remember if backup_exit_notify has some "STREAM*" variables made available to it...

...so maybe something like...

if the backup status = 0
then
  if the policy name = "blah"
  then
    if the client name = "blah"
    then
      if the stream_mumber = stream_max
      then
        submit new job
      fi
    fi
  fi
fi

...but if there are no stream numbers passed to backup exit notify then you may need to single stream the job from policyA.

PARTHASARATHI_S
Level 3

Hi Mark, i have copied the script from other server, hope this will work out on sunday backup.

If that work then i am well and good. Otherwise i may need some suggestions to sequence streams inside policy.

I will keep posted on monday.

sdo
Moderator
Moderator
Partner    VIP    Certified

FYI - backup exit notify is submitted/called at the end of all backup jobs... and so any code in it must be able to handle being called many times and concurrently...

...and so any use of any temporary files within the script will need to use a random number or two ;) and maybe the time too in the file names...

...and don't forget to make the script clean-up any temporary files that you use... just before it exits (for any reason)...

...and this script is fired and forgotten, and is not waited for, and its exit status is not checked, and does not have to run silently like some of the other notify scripts.

sdo
Moderator
Moderator
Partner    VIP    Certified

What you could do, to see what parameters and environment variables are available at instantiation time... is to put:

env >"/tmp/b-e-n-$$-env.txt"
set >"/tmp/b-e-n-$$-set.txt"

...in the script to see what variables are available when backup_exit_notify is actually running.

.

...but don't leave those statements in there for too long... otherwise your /tmp folder will fill up with possibly thousands of little text files.

Nicolai
Moderator
Moderator
Partner    VIP   

Please show me how you done it then 

Nicolai
Moderator
Moderator
Partner    VIP   

-i parameter only work on a master server or a client added to the master servers server list (last not really recommended for security reasons).

mph999
Level 6
Employee Accredited

@Nicolai:

You can't - Netbackup has no options to create dependencies : i am not fully agree to the statement, as we have other backup servers, where one policy trigger another policy.

 

Nicolai is correct, there is no built in method in NBU to run a scedule based on the outcome of another schedule.

It 'might' be possible using the *end scripts, but this is a 'custom' method (eg. you have to manually write the script) as opposed to a built in function or feature.