cancel
Showing results for 
Search instead for 
Did you mean: 

Script for checking policy

shahzeb1
Level 3

Hi All,

I am looking for a script to get netbackup policy name/s for a set of clients.

Regards

1 ACCEPTED SOLUTION

Accepted Solutions

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified
Please have a look at bpimagelist.
Try both these commands for 1 client to see what the output looks like:
bpimagelist -client (name) -d (start-date) -L
bpimagelist -client (name) -d (start-date) -l

Lowercase output will give info in one line that is easier to parse with awk and grep, but dates are given as Unixtime.
-L will give formatted output. Maybe easier to parse with egrep and awk.

I am not aware of any command or script that will only give 'last backup'.
You will need to add your own 'tweaks' depending on the output that you see in some test commands against a couple of client names.

View solution in original post

7 REPLIES 7

davidmoline
Level 6
Employee

Try using "bppllist -byclient <client> -l". For full details of the command options refer to the command reference manual.

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

I would run bppllist with -U or -L for more 'readable' output.

shahzeb1
Level 3

Thanks both. However I need it in a format where I provide the client name, and get the client policy name and last successful backup in a format like:

<client name> <policy name> <last successfull backup>

Regards

Hi shahbaz1

You should have asked for that information originally.

I can think of two ways to do what you want, one is with OpsCenter (not sure which report or whether you would require some customer SQL), the other would be using bperror and a bunch of scripting to filter out the information you want.

Look at the output from "bperror -client <client name>" (and then review the syntax for the bperror command). Problem with this is that it won't display policies that haven't been run for a period of time (>30 days), as the input for bperror has a limited range back. You may therefore need the output from the original command suggested to determine which policies the client is part of to ensure you report accurately. 

Someone may have already done this and be willing to share their scripts.

Good luck
David

Tape_Archived
Moderator
Moderator
   VIP   

Is this a Unix or Windows env??

Unix please.

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified
Please have a look at bpimagelist.
Try both these commands for 1 client to see what the output looks like:
bpimagelist -client (name) -d (start-date) -L
bpimagelist -client (name) -d (start-date) -l

Lowercase output will give info in one line that is easier to parse with awk and grep, but dates are given as Unixtime.
-L will give formatted output. Maybe easier to parse with egrep and awk.

I am not aware of any command or script that will only give 'last backup'.
You will need to add your own 'tweaks' depending on the output that you see in some test commands against a couple of client names.