clients in active policies only
Hi Guys,
i have the below script to find the clients in activie policies only.
[root@bkp01 admincmd]# cat activeclients.sh
#!/bin/ksh
PATH=$PATH:/usr/openv/netbackup/bin/admincmd
activeclients () {
bppllist -allpolicies | awk '$1=="CLASS" {pl=$2;set=0}
$1=="INFO" && $12==0 {set=1}
$1=="CLIENT" && set==1 {print $2}' | sort
-u
}
for client in `activeclients`
do
echo "$client:c"
bppllist -byclient $client | awk '$1=="CLASS" {printf("%s ",$2)}'
echo ""
done
But this script gives the client name present in deactivate policy also.I need clients present in active policies only with daily schedule configured.Please help me in changing the script parameter for the same.
output from the script:
[root@bkpma01 admincmd]# ./activeclients.sh > 1.txt
./activeclients.sh[16]: -u: not found
[root@bkpma01 admincmd]# cat 1.txt
lv100:c
bkpolicy1
lv101:c
bkpolicy2 bkpolicy2-VM
lv102:c
bkpolicy3 bkpolicy3-VM bkpolicy3_FF
lv103:c
bkpolicy4 bkpolicy4-VM bkpolicy4_FF
I do not have an active NBU installation to test myself.
Please 'play' with samples found in this forum.If you run the 1st part of above command : bppllist -L -allpolicies | egrep "^Policy Name: |^Active:"
You should see something like this: (I have used nbsu bppllist output from a customer)Policy Name: ADHOC_UNIX
Active: no
Policy Name: ADHOC_WINTEL
Active: yes
Policy Name: XXX_CATALOG
Active: yes
Policy Name: LINUX_DEV
Active: yesIf you then add
|^Client/HW
to the 'egrep' section, you will see the client names as well.
Adding
| grep -v no
will exclude all inactive policies.Yes, the output will look 'messy', but you can use your scripting skills to tidy up the output.
I have managed to do the following with output of bppllist -L -allpolicies > NBU_bppllist.txt :
cat NBU_bppllist.txt |egrep "^Policy Name: |^Active: |^Client/HW" |grep -v no >active.txt
cat active.txt |grep Client |awk '{print $2}'|sort -uAlso have a look at this post: https://vox.veritas.com/t5/NetBackup/Need-active-backup-clients-list/td-p/502761#M116656