07-26-2012 02:23 PM
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)
Solved! Go to Solution.
09-05-2012 09:51 AM
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....
07-26-2012 03:06 PM
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.
07-26-2012 06:13 PM
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.
07-27-2012 10:05 AM
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)
07-27-2012 05:02 PM
07-27-2012 05:08 PM
You can directly check clients and backup selections by looking contents of files under /usr/openv/netbackup/db/class/<policy_name>.
09-05-2012 09:51 AM
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....