cancel
Showing results for 
Search instead for 
Did you mean: 

command to print the o/p as follows

DPO
Level 6

I'm looking for a command to pull the client entries in below format . I know using bpplclients -policyname, we can get this report. But we have 100's of policies and so looking for a single command that would print the o/p as follows (it must show any duplicate client entries or a client in two policies)

client name, policy name, backup selection (optional)

1 ACCEPTED SOLUTION

Accepted Solutions

raj08
Level 4

Hi,

 

There is no direct way to do this. But you can run a script like below.

 

TO FIND THE PLOCIES ASSOCIATED WITH THE CLIENT

#!/bin/sh

#This will list out all the unique client from the master
bpplclients -allunique -noheader | awk '{print $3}' > /tmp/cl_list

#This will filter all the policies associated policies with the client
for i in `cat /tmp/cl_list`; do echo ======================================================; echo Hostname \\t $i; echo ==========================================; bppllist -L -byclient $i | grep "Policy Name" | awk -F":" '{print $2}' | sed 's/ *//g'; done

 

TO FIND THE BACKUP SLECTIONS

##As the backup selection is associated with policy, this will be best option to find the Backup selection
## You can run this as a different script also
##In order to find the backup selection of a particular policy
#!/bin/sh

echo "List out the Backup Directories for particular policy"
bppllist > /tmp/pl_list
for i in `cat /tmp/pl_list`; do echo ====================================================; echo Policy Name \\t $i; echo ==========================================; bppllist  $i -L | grep -i include | awk -F":" '{print $2}' | sed 's/ *//g'; done

 

 

Hope this helps....

View solution in original post

6 REPLIES 6

DPO
Level 6

In our environment, we have added a client in multiple policies so want to get the list of all clients along with their policy names that would help us to easily identify duplicate entries.

Yasuhisa_Ishika
Level 6
Partner Accredited Certified

Using "bppllist -allpolicies" command, you can get all policy configuation in single command.
Try "bppllist -allpolicies -U", "bppllist -allpolicies -L", "bppllist -allpolicies -l" and parse output as you like.

DPO
Level 6

The command is giving lot of unwanted stuff. I only need client name and its policy name that's it. Otherwise is there any command to print only duplicate client entries no matter whether the client belong to different policies (active or disabled)

Yasuhisa_Ishika
Level 6
Partner Accredited Certified
No such command in NetBackup. It is no so difficult to pick up policy name(CLASS), client name(CLIENT), and backup selectins(INCLUDE) from output of "bppllist -allpolicies -l" by scripting using sh, awk, perl or batch.

Yasuhisa_Ishika
Level 6
Partner Accredited Certified

You can directly check clients and backup selections by looking contents of files under /usr/openv/netbackup/db/class/<policy_name>.

raj08
Level 4

Hi,

 

There is no direct way to do this. But you can run a script like below.

 

TO FIND THE PLOCIES ASSOCIATED WITH THE CLIENT

#!/bin/sh

#This will list out all the unique client from the master
bpplclients -allunique -noheader | awk '{print $3}' > /tmp/cl_list

#This will filter all the policies associated policies with the client
for i in `cat /tmp/cl_list`; do echo ======================================================; echo Hostname \\t $i; echo ==========================================; bppllist -L -byclient $i | grep "Policy Name" | awk -F":" '{print $2}' | sed 's/ *//g'; done

 

TO FIND THE BACKUP SLECTIONS

##As the backup selection is associated with policy, this will be best option to find the Backup selection
## You can run this as a different script also
##In order to find the backup selection of a particular policy
#!/bin/sh

echo "List out the Backup Directories for particular policy"
bppllist > /tmp/pl_list
for i in `cat /tmp/pl_list`; do echo ====================================================; echo Policy Name \\t $i; echo ==========================================; bppllist  $i -L | grep -i include | awk -F":" '{print $2}' | sed 's/ *//g'; done

 

 

Hope this helps....