Forum Discussion

DRMan's avatar
DRMan
Level 2
10 years ago

Scripting Media Reports

I am frequently asked by our customers how to created Backup Exec reports that will show either:

1. Media written to since the last set of backups and the date it is due back

or

2. a Media Report for the tapes that are being sent offsite and a Media Report for the tapes that are due back from the offsite location

 

These reports need to be in the form of a CSV or TXT file and they need to be sent to the vendors server.

 

Not sure where to start...

 

Thanks

 

Scott

  • bpmedialist -l  is the command that helps to get this info

    in below line 1434762470 is the expire date, 

    001122 *NULL* 1 20 1426309122 1426727270 1434762470 0 4119974176 10 10 5 1 0 8 1024 0 5664461 0 0 0 0 0 0 0 0

    so you need to get the script to feach this info, and convert into a human readable time, .

    bpmedialist (without -l ) can give the time in human readable but that output is not scrpting friendly.

  • Hi Scott, I've been thinking about this a bit more.  It should be fairly straightforward to create a media list report which could be grouped into perhaps three sections/blocks:

    Section 1)  A list of used media, sorted by most recently used date at to the top of the list

    Section 2)  The same list of used media, but this time sorted by shortest remaining life-span, i.e. media that are due to expire soonest.

    Section 3)  A list of scratch media (perhaps also sorted).

    .

    And if the script were to have some CLI switches, so that one could tweak the 'selection' criteria of media, e.g. CLI switch options maybe along the lines of:

    -exclude_pools a,b,c,....

    -include_pools d,e,f,...

    -exclude_retentions 1,2,3,...

    -include_retentions 4,5,6,...

    -exclude_barcodes ([0-Z][?*])([0-Z][?*])([0-Z][?*])([0-Z][?*])([0-Z][?*])([0-Z][?*])    i.e. a pattern match mask.

    -include_barcodes (as above)      i.e. a pattern match mask.

    -max_used N         (i.e. to limit the size of the lists in section 1 and section 2)

    -max_scratch N      (i.e. to limit the size of the list in section 3)

    -oldest_scratch | -newest_scratch        (i.e. make the list of scratch media sort by oldest or most recently scratch)

    .

    I suspect that the issue/problem is a procedural issue/problem, which just needs a helping hand in 'selecting' the media for one of two actions - selecttion for off-site vault, and selection for recall.  I'm not sure I could go so far as to write a tool to manage the ejection or import/inventory and/or location (sometimes managed by the media 'volume group' attribute) of media.  But a report, with some CLI filter switches should be reasonably do-able.

    .

    I'd be fairly comfortable writing something like this in VBScript for Windows - but I'm not sure that I could produce something in say korn shell for Unix, or Perl.  So, this would only be useful at sites with either a Windows based master server, or media server, or Windows Admin Console (and not sites/servers with only Windows Java Admin Console) - because the script would need to issue NetBackup 'admin' level list commands in order to collect the meta-data that it needs.

7 Replies

  • just wanted to confirm , are you looking for Backup Exec  or netbackup?

    you have selected the option netabckup and your post says you are looking for Backup Exec .. just wanted to make sure... 

  • how you are ejecting /sending tapes.. . are you using Vault to eject the tapes, or Doing manual ejection?

    if you are using the Vault , Vault can generate these report automatially , media going to offsite, and media pick list from offsite..

    if tapes are being ejected manully, they needs to be tracked manaully, where the scripts efforts are required..

  • I have some clients that use Vault and some that do manually.. I am guessing manually. I wanted to try to do it manually on my system so I could at least point them in the right direction.

    If there is a section in the Admin guide .. I would be glad to start there..

    I don't mind putting in effort, just really need a starting point.

     

     

  • bpmedialist -l  is the command that helps to get this info

    in below line 1434762470 is the expire date, 

    001122 *NULL* 1 20 1426309122 1426727270 1434762470 0 4119974176 10 10 5 1 0 8 1024 0 5664461 0 0 0 0 0 0 0 0

    so you need to get the script to feach this info, and convert into a human readable time, .

    bpmedialist (without -l ) can give the time in human readable but that output is not scrpting friendly.

  • Scott - can I ask some questions, because the requirements seem (to me) to be subjective...

    1) Media written to since the last set of backups and the date it is due back

    1a) How would one qualify what constitutes the last set of backups?  Just the most recent backup of any type (full,cinc,diff,user) - or all backups for any client since and including the last full?  Or is to be date/time framed?

    1b) What qualifies a media for due back?  That all content has actually expired and media is now scratch?  Or is about to fully expire, but within what time frame?

    1c) Do you have to take into consideration volume pools, media type, retention periods, backup types?  Only certain backup policies, or only certain clients?

    1d) Multiple different rule sets within any one given environment?

    .

    2) a Media Report for the tapes that are being sent offsite and a Media Report for the tapes that are due back from the offsite location

    How will media be selected for ejection?  What will the selection criteria be?

    .

    3) These reports need to be in the form of a CSV or TXT file and they need to be sent to the vendors server.

    Can you expand upon what "sent to the vendor's server" means?  Hardware vendor?  Offsite storage service provider?  Services/solution vendor?  Not to the customer?  Not to admins/Ops staff?

    .

    When I look at this, it would seem that you need a truely flexible suite of functionality which could be adpated for multiple different environments.  This would be a large software development/engineering undertaking, and would effectively result in re-inventing the wheel - because it's all been done before... i.e. NetBackup Vault... which would do eveything you need.  I dare say that it would cost more (in man hours, and elapsed time, and debugging, and errors, and service interruption, etc) to develop your own tools than to purchase NetBackup Vault.

  • Hi Scott, I've been thinking about this a bit more.  It should be fairly straightforward to create a media list report which could be grouped into perhaps three sections/blocks:

    Section 1)  A list of used media, sorted by most recently used date at to the top of the list

    Section 2)  The same list of used media, but this time sorted by shortest remaining life-span, i.e. media that are due to expire soonest.

    Section 3)  A list of scratch media (perhaps also sorted).

    .

    And if the script were to have some CLI switches, so that one could tweak the 'selection' criteria of media, e.g. CLI switch options maybe along the lines of:

    -exclude_pools a,b,c,....

    -include_pools d,e,f,...

    -exclude_retentions 1,2,3,...

    -include_retentions 4,5,6,...

    -exclude_barcodes ([0-Z][?*])([0-Z][?*])([0-Z][?*])([0-Z][?*])([0-Z][?*])([0-Z][?*])    i.e. a pattern match mask.

    -include_barcodes (as above)      i.e. a pattern match mask.

    -max_used N         (i.e. to limit the size of the lists in section 1 and section 2)

    -max_scratch N      (i.e. to limit the size of the list in section 3)

    -oldest_scratch | -newest_scratch        (i.e. make the list of scratch media sort by oldest or most recently scratch)

    .

    I suspect that the issue/problem is a procedural issue/problem, which just needs a helping hand in 'selecting' the media for one of two actions - selecttion for off-site vault, and selection for recall.  I'm not sure I could go so far as to write a tool to manage the ejection or import/inventory and/or location (sometimes managed by the media 'volume group' attribute) of media.  But a report, with some CLI filter switches should be reasonably do-able.

    .

    I'd be fairly comfortable writing something like this in VBScript for Windows - but I'm not sure that I could produce something in say korn shell for Unix, or Perl.  So, this would only be useful at sites with either a Windows based master server, or media server, or Windows Admin Console (and not sites/servers with only Windows Java Admin Console) - because the script would need to issue NetBackup 'admin' level list commands in order to collect the meta-data that it needs.