cancel
Showing results for 
Search instead for 
Did you mean: 

How to get a list of active policies

Dennis_Strom
Level 6
I can get a list of policies and or change attributes but how do I get a list of active polices through the CLI if possible. I am runnig Solaris.
Thank you
12 REPLIES 12

Stumpr2
Level 6
Use bppllist
bppllist -l (thats a small ell letter)
KEY de-activatedMy favorite color is green
Bob Stump

Dennis_Strom
Level 6
I have tried
bppllist -L -allpolicies -keyword active I do not get an error but I do not get a list of active policies.

If I enter bppllist -l I get a large dump of what is the contents of the policy but no easy way to determin if the policy is active or not. If I had to run this command on each policy I can put it in a for loop. But, so far I do not see an easy way to extract whether or not the policy is active.

I need a way to grep through and determin which policy is active so that I can put that into a for loop so that I can change the volume pool and retention on the schedule of that policy.

Stumpr2
Level 6
look again at the output
there is one line that says

KEY de-activated
That indicates that the policy has been de-activated (not active)

If it is active then it will say:
KEY *NULL*My favorite color is green
Bob Stump

Dennis_Strom
Level 6
Are you running Solaris? I looked at both of my master servers Netbackup 6.0mp3 and 5.1mp2 and where it says KEY it says NULL whether the policy is active or not. Solaris 9 both boxes.

5.1mp2 inactive policy
157 >bppllist IQHS150A -l
CLASS IQHS150A *NULL* 0 500000 0 *NULL*
NAMES
INFO 13 0 0 0 *NULL* 0 0 10 0 0 1 0 0 0 0 1 0 0 0 *NULL* 1 1 15 0 0 0 0 0 2
KEY *NULL*
BCMD *NULL*
RCMD *NULL*
RES wolf-tld-1 *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL*
POOL Full NetBackup NetBackup NetBackup NetBackup NetBackup NetBackup NetBackup NetBackup NetBackup
FOE 0 0 0 0 0 0 0 0 0 0
CLIENT iqhs150a PC Windows2000 0 0 0 0 *NULL*
INCLUDE ALL_LOCAL_DRIVES
SCHED Full 0 2 432000 8 0 0 0 *NULL* 0 0 0 0 0 0
SCHEDWIN 0 0 0 0 0 0 0 0 0 0 0 0 54000 18000
SCHEDRES *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL*
SCHEDPOOL *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL*
SCHEDRL 8 1 1 1 1 1 1 1 1 1
SCHEDFOE 0 0 0 0 0 0 0 0 0 0
SCHED Win2k-inc 1 2 64800 4 0 0 0 *NULL* 0 0 0 0 0 0
SCHEDWIN 0 0 73800 32400 0 0 73800 32400 0 0 0 0 0 0
SCHEDRES *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL*
SCHEDPOOL Incr *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL*
SCHEDRL 4 1 1 1 1 1 1 1 1 1
SCHEDFOE 0 0 0 0 0 0 0 0 0 0

6.0mp3 active policy
>bppllist L100-test -l
CLASS L100-test *NULL* 0 600000 0 *NULL*
NAMES
INFO 0 0 0 0 *NULL* 0 0 2147483647 0 0 0 0 0 0 0 0 0 0 1131570047 E68A37801DD111B2AC1F0800208AFAE7 1 1 15 0 0 0 0 0 2 0
KEY *NULL*
BCMD *NULL*
RCMD *NULL*
RES aserv8-hcart3 *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL*
POOL FULL NetBackup NetBackup NetBackup NetBackup NetBackup NetBackup NetBackup NetBackup NetBackup
FOE 0 0 0 0 0 0 0 0 0 0
CLIENT aserv8 Solaris Solaris9 0 0 0 0 *NULL*
CLIENT aserv6 Solaris Solaris8 0 0 0 0 *NULL*
INCLUDE /work
SCHED Full 0 2 604800 4 0 0 0 *NULL* 0 0 0 0 0 0 -1
SCHEDWIN 0 0 0 0 0 0 0 0 0 0 66000 20100 0 0
SCHEDRES *NULL* aserv8-hcart3 *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL*
SCHEDPOOL *NULL* Monthly *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL*
SCHEDRL 4 0 1 1 1 1 1 1 1 1
SCHEDFOE 0 0 0 0 0 0 0 0 0 0
SCHED Inc 1 1 604800 4 0 0 0 *NULL* 0 1 0 0 0 0 -1
SCHEDWIN 0 0 0 0 0 0 64800 21300 0 0 0 0 0 0
SCHEDRES *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL*
SCHEDPOOL INCR *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL*
SCHEDRL 4 1 1 1 1 1 1 1 1 1
SCHEDFOE 0 0 0 0 0 0 0 0 0 0

Stumpr2
Level 6
oh...I'm sorry!

This only works if you put the word "de-activated" in the key-word phrase on the policy attributes page.

I'm not only sorry, but embarressed.My favorite color is green
Bob Stump

Stumpr2
Level 6
OK...heres for the green

# cd /usr/openv/netbackup/db/class
# find . -name info -exec grep -l "ACTIVE 0" {} \;

this will give you a list of the active policies
change the 0 to a 1 for the inactive

I feel much better now!My favorite color is green
Bob Stump

Dennis_Strom
Level 6
Bob,
Thank you

You earned the extra helpful points since I did not know you could add key words to the attributes page. That is cool, the find trick will work better with a script. I can strip off the extra stuff and have just what I need.Message was edited by:
Dennis Strom

Stumpr2
Level 6
Thanks for the reward!
Sometimes it is necessary to temporarily deactivate a policy. Normally if I only need to de-activate a policy for a weekend, then I will use the "Active Go into effect at" and give it the date for Monday. Then it will automatically re-activate itself. Cool!
Sometimes you do not know when to re-activate it. In those cases I de-activate and use the keyword so that I will know that a policy was purposefully de-activated. It simply slipped my mind when I was trying to answer your question.
Sorry for the confusion.

Dennis_Strom
Level 6
So this is the final product I came up with for a list of active policies.
>find . -name info -exec grep -l "ACTIVE 0" {} \; | sed "s/\.\///g" | sed "s/\/info//g"

or since as we all know with unix there is always more than one way

>find . -name info -exec grep -l "ACTIVE 0" {} \; | cut -f2 -d"/"

mbahmani
Level 1

#!/bin/bash

# Netbackup_get_backup_selection_all_policy.sh
for i in $(bppllist -l)
do
echo ======================
echo $i
bppllist $i -l|grep -E 'CLIENT|INCLUDE' |grep -v WHOLE_DATABASE|awk '{print $2,$3,$4}';
echo ----------------------
done

Tape_Archived
Level 6
   VIP   

A single liner for policies that are NOT active

for i in `bppllist`;do if ! (bpplinfo $i -L |grep Active | grep -q yes); then echo $i; fi;done

jhromeror
Level 3

simple and dirty....

*NIX: bppllist -json | egrep -i 'class_name|active'