Video Screencast Help

How to create 200 policies in a single step in Netbackup 7.5

Created: 22 Feb 2013 | 7 comments

Hi,

 

I need to create 200 policies in NBU. But if i create one by one it takes more than 2 hours of time. Can you please suggest me any shortcut or trick to create it in one step ?

-Abhinay

Operating Systems:

Comments 7 CommentsJump to latest comment

Yasuhisa Ishikawa's picture

just scripting!

I used to create template policy by hand, copy it to actual policyby "bppolicynew policy_name -sameas template_policy", then add clients into policy by "bpplclient policy_name -add ...", and add files by "bpplinclude policy_name -add path_to_be_backed_up".

Authorized Symantec Consultant(ASC) Data Protection in Tokyo, Japan

Mark_Solutions's picture

Less policies is better - hence the term policy.

Can I ask why you need 200?

The only real shortcut is the schedules which can be pasted from one policy to another

Authorised Symantec Consultant

Don't forget to "Mark as Solution" if someones advice has solved your issue - and please bring back the Thumbs Up!!.

Abhinay077's picture

Well.. i m testing for HP plugin OST with Netbackup.. its for qualification of OST plugin with Netbackup

Mark_Solutions's picture

I guess the bppolicynew suggested would be the way to go then

You could just write a script file with variable and a loop to do it for you

Authorised Symantec Consultant

Don't forget to "Mark as Solution" if someones advice has solved your issue - and please bring back the Thumbs Up!!.

Vickie's picture

 

To create that many (200 + ) similiar type of policy can be done by using command bppolicynew command in a script, but in case you would required to set different parameter for all of them would be tough task.  
 
By single command or in one go, as per me It would not be possible.
Chrisb2k's picture

I'd perl it if perl is available:

#!/usr/bin/perl
# 
$count = 0;

# Loop
while ($count <= 200) {	
  print qq(Creating policy policy_name_$count ...\n);
  `/usr/openv/netbackup/bin/admincmd/bppolicynew policy_name_$count -sameas existing_policy_name`;
   $count ++;
}

... or something similar. use less than 200 to start with to test you are getting what you want then change the $count variable if you are happy.

If there is something repeatable and incrementable (is that a word?) in the include list and client names then you can script these too using a similar script or within this one using bpplclients, bpplinclude etc. as mentioned above.

If not, then the addition of these will necessarily be manual :(

 

Vickie's picture

You can use this script as well.

while read line
do
`/usr/openv/netbackup/bin/admincmd/bppolicynew $line -sameas existing_policy_name`
polname=`/usr/openv/netbackup/bin/admincmd/bppllist $line -U`
echo $polname
done < /tmp/policylist

Step to use the script are given below,

1) Go to /tmp directory
2) Create file name as "policy.sh" in tmp .
3) chmod 700 "policy.sh"
4) Create file name as "policylist" . Put required policy name in this file.
5) Run script as
 a) ./policy.sh

This will create a policy with name given in "policylist" file, and once created will use "bppllist command to check if policy created or not. If creates it will redirect the name of policy.

But try this with fewer number of policy name in "policylist", if that work as you needed. Add as number of policy as you want.

Here I have attached the script and some test policy name you can use. Just change the file extension from "policy.txt" to "policy.sh" and "policylist.txt" to "policy" only.
 

Hope this may by helpfull for you.

AttachmentSize
policylist.txt 63 bytes
policy.txt 281 bytes