cancel
Showing results for 
Search instead for 
Did you mean: 

how do i generate a policy list along with storage unit configured in command line

anishC5
Level 5
Partner Certified

Hi All,

Any ideas please how do i generate a policy list along with storage unit configured in command line using bppllist or any other command?

I also need it to get generated in a txtfile may be...

please help.

Thanks, anish

1 ACCEPTED SOLUTION

Accepted Solutions

Andy_Welburn
Level 6

My ears were burning!

for POLICY in `bppllist`
do
RESIDENCE=`bppllist $POLICY -L|grep "^Residence"|grep -v Lifecycle|awk '{print $2}'`
echo "$POLICY $RESIDENCE" >> policy_stu.txt
done

 

But bear in mind that this only shows the storage unit associated with the policy - it could be over-ridden by the schedule settings, hence my original quoted by sri vani above

View solution in original post

10 REPLIES 10

sri_vani
Level 6
Partner

Try these: https://www-secure.symantec.com/connect/forums/how-do-i-get-policy-settings-netbackup

For Unix:
 
echo "List all NBU policies"
/usr/openv/netbackup/bin/admincmd/bppllist > /tmp/output.txt
echo ""
echo "Get detail info on each policy"
 
echo ""
for i in `cat /tmp/output.txt`
do
echo "Get detail info on policy $i"
/usr/openv/netbackup/bin/admincmd/bppllist $i -U >> /tmp/outputpolicy.txt
done
 

sri_vani
Level 6
Partner

also another good one by Andy

https://www-secure.symantec.com/connect/forums/list-storage-unit-all-policies-environemnt

for POLICY in `bppllist`
do
echo
bppllist $POLICY -L|egrep "^Policy Name|^Residence|^Schedule|^  Residence"|grep -v Lifecycle
done

Mark_Solutions
Level 6
Partner Accredited Certified

Are you saying you just want the policy name along with its storage unit?

If you want everything then bppllist -allpolicies -U>c:\policies.txt does the job

 

anishC5
Level 5
Partner Certified

Any ideas if i would want the report as follows:

Policy | Storage_UNIT |

do i add the -L switch please?

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

Have you tried Andy's command?

It really does not matter if you use -U or -L for the info you want.

Andy_Welburn
Level 6

My ears were burning!

for POLICY in `bppllist`
do
RESIDENCE=`bppllist $POLICY -L|grep "^Residence"|grep -v Lifecycle|awk '{print $2}'`
echo "$POLICY $RESIDENCE" >> policy_stu.txt
done

 

But bear in mind that this only shows the storage unit associated with the policy - it could be over-ridden by the schedule settings, hence my original quoted by sri vani above

anishC5
Level 5
Partner Certified

I use the following command but not getting any output.. anything I am missing please?

 

 bppllist -U -allpolicies|egrep "^Policy name|^Residence">/tmp/policy.txt

Andy_Welburn
Level 6

If you run bppllist -U -allpolicies without the egrep you'll see why:

^Policy Name - upper case "N"

^Residence - no lines begin with the word "Residence" they start with 2 or 4 spaces then Residence (that is one subtle difference between the output using -U cf -L)

Nicolai
Moderator
Moderator
Partner    VIP   

Just to supplement Andy:

Use the -i qualifier for egrep to ignore upper/lower case

-i, --ignore-case
 
Ignore  case  distinctions  in  both  the PATTERN and the input  files.

sri_vani
Level 6
Partner

Quiet obvious ,

The reverberation of the names Mariana & Andy,(Martin,Mark,Nicolai,...........) will spill knowledge and kill issues smileywink