Adding holidays to ALL schedules
Created: 28 Jan 2013 | Updated: 28 Jan 2013 | 3 comments
This issue has been solved. See solution.
Hi,
Netbackup 7.1.0.4 running on Solaris 10.
In our dev environment I just gor a standalone tape drive, manual changes of tapes.
I need to exclude all holidays when no one is around in the office changing tapes.
This if IF the holiday is on a Monday or Tuesday when we change tapes, Daily, Weekly, Monthly.
I have about 20 schedules, but browsing through all of these an excluding manually is a tedious job.
Is there a smarter way of doing this? Scripting something?
I was looking for a Schedule template to add but I can't find any way of doin that.
Whats the smartest way of doin this?
Best regards
- Roland
Discussion Filed Under:
Comments 3 Comments • Jump to latest comment
It's not easy as there is no global holiday setting in NetBackup
It also depends on if you have consistent names for your schedules - such as Daily, Weekly etc.
About the only thing you could do is pipe out your policies (make a directory named c:\excludes) by using:
\netbackup\bin\bppllist -l >c:\excludes\policies.txt
You may want to take your catalog backup out of this?
Make a file named exclude.bat in that directory and in it put:
for %%a in (policies.txt) do "c:\program files\veritas\netbackup\bin\admincmd\bpplschedrep" %%a -label Daily -excl mm/dd/yyyy
pause
Note that the main line is all on one line and the pause just keeps the window open so that you can read any errors.
This is for the schedule named Daily - so add lines for the the other schedule names
So test running this first with just one policy in the text file to make sure it works and edit the path to suit your environment (if you need to run if from a Windows server that is not the Master (admin console / media server) then add -M masterservername on the end of the command.
If you are happy with it just copy and paste the lines in the batch file several times so that you just have to edit the dates on each line and the script will apply it to the Schedules named in each policy
Well worth running nbpemreq -updatepolicies after doing this to get EMM to re-read all of the policies and schedules
If you do use standard schedule names (bearing in mind it is case sensitive) then I could make this a little fancier for you if you wish but see how you get on first.
Hope this helps
Authorised Symantec Consultant
Don't forget to give a "Thumbs Up" or mark as "Solution" if someones advice has helped you.
Hi,
Thanks worked brilliantly,
That was quite easy, except I had to modify it slightly because I run on Solaris.
/var/tmp/netbackup-holidays.ksh:
#!/bin/ksh # # function set_exclude { /usr/openv/netbackup/bin/admincmd/bpplschedrep $1 $2 -excl $3 } cat /var/tmp/netbackup-holidays.txt |& while read -p Line do set_exclude $Line 03/11/2013 set_exclude $Line 03/12/2013 set_exclude $Line 04/01/2013 set_exclude $Line 04/02/2013 set_exclude $Line 06/10/2013 set_exclude $Line 06/11/2013 set_exclude $Line 11/05/2013 set_exclude $Line 11/06/2013 doneIn /var/tmp/netbackup-holidays.txt I just have all the lines with the Policy and Schedule-name.
Like
PolicyName Daily-Full
PolicyName Weekly
PolicyName Monthly
- Roland
Great stuff - could also be done my way if you have a Windows PC with an admin console installed - but nice to see your unix version
Glad to have helped
Authorised Symantec Consultant
Don't forget to give a "Thumbs Up" or mark as "Solution" if someones advice has helped you.
Would you like to reply?
Login or Register to post your comment.