02-26-2016 03:14 AM
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.
Solved! Go to Solution.
02-29-2016 02:24 AM
@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.
02-26-2016 03:24 AM
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.
02-26-2016 03:49 AM
I agree with Nicolai.
What is the difference between policy A and B?
Are they backing up same or different data?
02-26-2016 04:08 AM
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
02-26-2016 04:21 AM
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.
02-26-2016 05:26 AM
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
02-26-2016 05:41 AM
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.
02-26-2016 05:49 AM
aha maybe that was the one in the back of my head! :)
02-26-2016 05:52 AM
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?
02-26-2016 07:40 AM
02-26-2016 08:18 AM
@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
02-26-2016 08:34 AM
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?
02-26-2016 09:24 AM
02-26-2016 09:30 AM
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.
02-26-2016 09:31 AM
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.
02-26-2016 09:33 AM
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.
02-26-2016 09:39 AM
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.
02-29-2016 12:01 AM
Please show me how you done it then
02-29-2016 12:03 AM
-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).
02-29-2016 02:24 AM
@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.