05-25-2017 05:46 AM
Hi Techiz,
I just check from command guide that bppllist -byclient does a case insensitive search of client name, is there a way I can make this search case sensistive to search exact client name to find it's policies.
Solved! Go to Solution.
05-25-2017 10:03 AM
Ohh gosh I was in 6th Standard back then in 2000
So there is no way I can have bppllist to have client name as exact search?,
Currently I am doing a painful for loop
for pol in $(for pol_exact in $(sudo /usr/openv/netbackup/bin/admincmd/bppllist -byclient $client -l 2>/dev/null | awk '$1~/^CLASS/ {print $2}'); do exact=$(sudo /usr/openv/netbackup/bin/admincmd/bppllist $pol_exact -l 2>/dev/null | awk '$1~/^CLIENT/ {print $2}' | grep -c $client); if [ "$exact" -eq 0 ]; then continue; else echo $pol_exact; fi; done)
do
The issue is it is increasing complexity of the script and in turn increasing the time to run for the script.
Any other suggestions?
Thanks
Sid
05-25-2017 05:57 AM
Hi Sid,
Somewhere since the year 2000 NetBackup dropped case sensitivity for client names. It used to work like that but, if I recall correctly, close the when NetBackup appliances were released (2011/2012) it used to become a pain in the backside when doing duplications.
The duplications failed when one applliance would have a upper case name and the other a lower case. You had to make links from the UPPER > lower or vice versa so I think the code was update to ignore case.
That's what I recall :)
05-25-2017 10:03 AM
Ohh gosh I was in 6th Standard back then in 2000
So there is no way I can have bppllist to have client name as exact search?,
Currently I am doing a painful for loop
for pol in $(for pol_exact in $(sudo /usr/openv/netbackup/bin/admincmd/bppllist -byclient $client -l 2>/dev/null | awk '$1~/^CLASS/ {print $2}'); do exact=$(sudo /usr/openv/netbackup/bin/admincmd/bppllist $pol_exact -l 2>/dev/null | awk '$1~/^CLIENT/ {print $2}' | grep -c $client); if [ "$exact" -eq 0 ]; then continue; else echo $pol_exact; fi; done)
do
The issue is it is increasing complexity of the script and in turn increasing the time to run for the script.
Any other suggestions?
Thanks
Sid
05-26-2017 12:48 AM
i dont' understand what you're trying to achieve. Please explain in detail with example.
05-26-2017 02:24 AM
grep -i = case insensitive search
Netbackup is not the problem, script need to be adapted for insensitive case search ans you will be all good.
05-26-2017 02:35 AM
So here it is,
1. I have a list of clients which i searched from bpplclients -allunique | grep -i $client_from_list (from the list), as client names given could be upper case of lower case.
2. Now when i grep the list of clients from Netbackup out of the given clients, i do a bppllist -byclient, here when i give client name it does a case insensitive search, i.e ABC in policy Pol1 and abc in Pol2, when i do bppllist -byclient abc, it will give me both the polices pol1 & pol2,
3 For this reason what i did now is another for loop of the policies given by -byclient paramter and grep (as case sensitive) client entry if it matches with the client given in the first place then only that policy name is given else continue. e.g in this for loop bppllist pol1 -l | awk '$1~/^CLIENT/ {print $2}' | grep -c $client_from_allunique, if this is 1 then true and pol name given else continue for next policy listed by -byclients command.
Hope i have explained the whole situation.
Thanks
Sid
05-26-2017 09:35 PM
"i.e ABC in policy Pol1 and abc in Pol2, when i do bppllist -byclient abc, it will give me both the polices pol1 & pol2"
Well it should right? Its the same client.
05-31-2017 04:18 AM - edited 05-31-2017 04:19 AM
right catch, However it's not the case with my environment, they are different.