Forum Discussion

achebib's avatar
achebib
Level 4
8 years ago

List images

Hi, 

 

I would like to know a command which lists the time when backup was created, when it is going to expire and the backup id.

It is necessary for bpexpdate command.

  • My 2c:

    The TN shows you all options for bpimagelist. 

    Although it seems daunting, the command (and all options) is safe and cannot 'break' anything.

    Your initial choice is between: -media -l | -L | -U | -idonly

    -media will give you media-id and not much else.
    -l will give you everything in one long line in unformatted output (dates will be Unixtime and no headers)
    -L will list each image with detailed info in lengthy format. 
    -U in 'user' format with limited info (no image-id)
    -idonly will give image id and not much else.

    So, for everything you want, your choices are -l or -L

    For -l , you will need to lookup the meaning of each value and parse the output to get the fields that you want (and then convert unixtime to 'normal'.)
    (https://www.veritas.com/support/en_US/article.TECH5584)

    -L is easiest to read.

    You may want to add more options such as -d start-date -e end-date  and -client client-name
    (plus others that deem relevant to what you are looking for).

     

    • Nicolai's avatar
      Nicolai
      Moderator

      Well said Marianne.

      Mastering bpimagelist will help you do a lot the more advance operation in Netbackup. So start playing with the command :-)

  • Hi,

    You can use bpimagelist command...Take a look this TN there are many options and examples.

    i.e

    Example 2 - List all images that were written today:

     

    # bpimagelist -U
    Backed Up        Expires     Files     KB C Sched Type   Policy
    ---------------  -------- -------- ------ - ------------ ----------
    01/27/2012 01:08 02/03/2012  1122  202624 N Full Backup  3590Grau
    01/27/2012 01:01 02/03/2012  1122  202624 N Full Backup  IBM35pol
    01/27/2012 03:01 02/03/2012   531 1055104 N Full Backup  DELLpol
    01/27/2012 02:01 02/03/2012   961   31776 N Full Backup  QUALpol
    01/27/2012 01:08 02/03/2012  2063  603328 N Full Backup  IBM35pol
    01/27/2012 01:01 02/03/2012  2063  603328 N Full Backup  3590Grau

    https://www.veritas.com/support/en_US/article.000117440

     

    Regards,

     

    Thiago

  • bpimagelist is the command you are looking for.

    e.g: List all images in 2017

    bpimagelist -d 01/01/2017 | grep IMAGE | awk '{ print $14" "$16 }'

    Field 14 and 16 are Backup Time and Expiration time in epoch format. Epoch time stamps can be converted to human time by running bpdbm -ctime {epoch value}

    DOCUMENTATION: What are the different fields in "bpimagelist -l" output?

    http://www.veritas.com/docs/000032604