Forum Discussion

shahzeb1's avatar
shahzeb1
Level 3
6 years ago

Script for checking policy

Hi All,

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

Regards

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

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

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

  • 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

    • davidmoline's avatar
      davidmoline
      Level 6

      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