cancel
Showing results for 
Search instead for 
Did you mean: 

bppllist -byclient doesn't checks for exact client name.

Sid1987
Level 6
Certified

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.

1 ACCEPTED SOLUTION

Accepted Solutions

Ohh gosh I was in 6th Standard back then in 2000 Smiley LOL

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

View solution in original post

7 REPLIES 7

RiaanBadenhorst
Moderator
Moderator
Partner    VIP    Accredited Certified

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 :)

Ohh gosh I was in 6th Standard back then in 2000 Smiley LOL

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

RiaanBadenhorst
Moderator
Moderator
Partner    VIP    Accredited Certified

i dont' understand what you're trying to achieve. Please explain in detail with example.

Nicolai
Moderator
Moderator
Partner    VIP   

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.

Sid1987
Level 6
Certified

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

RiaanBadenhorst
Moderator
Moderator
Partner    VIP    Accredited Certified

"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.

right catch, However it's not the case with my environment, they are different.