cancel
Showing results for 
Search instead for 
Did you mean: 

Short command\script to output all expired media between 2 dates!!!

thestraycat
Level 2

Hi guys,

I'd really like to be able to run a script or command against out master server to get a list of tapes that are available to be written too but they must meet a criteria:

 

Tapes must be from the "Weekly" Pool \ Pool 5

Tapes listed must be expired 

Tapes must be within a timeframe (from 01/01/2008 -> 3 months before current date)

and the media id \ label must be present in the output.

 

I've tried VMQUERY, BPIMAGELIST with a few syntax's but i honestly thought netbackup would have a command switch for outputting tapes that are expired and older than 3 months old to a text file!

 

Anyone?

 

1 ACCEPTED SOLUTION

Accepted Solutions

RamNagalla
Moderator
Moderator
Partner    VIP    Certified

so you are looking for tapes which are expired date has older than 3 months now.. 

 i am curious to know... any reason why you are not looking for all expired tapes.. or  expired tapes with in 3 months... 

View solution in original post

10 REPLIES 10

RamNagalla
Moderator
Moderator
Partner    VIP    Certified

so you are looking for tapes which are expired date has older than 3 months now.. 

 i am curious to know... any reason why you are not looking for all expired tapes.. or  expired tapes with in 3 months... 

mph999
Level 6
Employee Accredited

The available_media script in the netbackup/bin/goodies dir may assist you here ... I don't have the output to hand, but you should be able to see the tapes that are unused, sorted by pool, then take these tape and run through vmquery -m to get the date info ...

Will_Restore
Level 6

nbemmcmd command might be the way to proceed. 

 

nbemmcmd -listmedia -poolname Scratch

will provide details of scratch volumes (use the actual scratch pool name in your own environment)

then look at Previous Pool Name:  (Pool 5 in your case)

then look at Last Written:  (unfortunately Data Expiration: field will aready be erased)

 

Sorry I'm not that proficient in Windows scripts; guessing you could use findstr to extract what you need.

 

thestraycat
Level 2

Sorry it's probably not that clear... basically the retention date of the tapes in the weekly pool are 3 months... so any tapes that are older than 3 months from today should be expired... so i'm after all weekly tapes older than 3 months..

thestraycat
Level 2

I dont think we actually use a scratch pool so i can't reference it... I looked into the available media script but dont know how to filter it using findstr... as the  it's hard to reference a date that is 90 days in the past from the current day hence why i was hoping to use a netbackup command with a built in syntax like bpimagelist's switch for stating 2 dates X and Y ... I was wondering whether anyone had any example script in batch for me to look into? or something in VB as a last result?

mph999
Level 6
Employee Accredited
Ahh, windows ... I can probably do it in Unix, Mark Solutins is you're man for Windos scripting ...

Yasuhisa_Ishika
Level 6
Partner Accredited Certified

As WR wrote, you can not get expiration date of media that have been already expired. only media you can get its expiration date is currently assigned media.

thestraycat
Level 2

What does the expiration date field default too when the tape has been expired? something like? "---" 

Will_Restore
Level 6

just a single dash  -

 

Marianne
Level 6
Partner    VIP    Accredited Certified

Best to be proactive and see when tapes are due to expire rather than trying to find information that no longer exists (expiration date of 3 months ago).

Use 'Media Summary' report with Verbose option selected.
Run this report on a regular basis.