cancel
Showing results for 
Search instead for 
Did you mean: 

How to get pool and retention level list of tapes in one command

tollboy
Level 4

Hello Everyone,

 

As the subject sayes I need a command from which I can get pool and retention level of the tapes in one command.

 

This is how I am achiving it right now as following:

Below will list all the tapes which are currently in library and are in pool which contains dup in its name.

vmquery -W -a | awk '{if($12~/dup/ && $7~/TLD/ )print $1}' > pool.txt

 

Secondly:

 bpmedialist -mlist -l | awk '{if($12<9)print $1}' > retention.txt

Now for getting all the tapes which are in library && in dup pool && with retention less then 9. I do

/usr/sfw/bin/ggrep -f pool.txt retention.txt > list.txt

 

I dont want to use GUI (filters can be easily applied there), as I am writing a script to do some tape rotation. Please let me know if there is any way to do this via single command.

 

Basically I need to know the NBU command which list  pool as well as retention level of the tape in one go.

 

Thanks in advance.

--

Regards

1 ACCEPTED SOLUTION

Accepted Solutions

mph999
Level 6
Employee Accredited

Try the available_media script.

I think this is in the netbackup/goodies dir from memory.

Martin

View solution in original post

10 REPLIES 10

mph999
Level 6
Employee Accredited

Try the available_media script.

I think this is in the netbackup/goodies dir from memory.

Martin

tollboy
Level 4

Martin,

Thanks for the reponse. But available media script does not give retention level of the tape.

Regards,

mph999
Level 6
Employee Accredited

It does ...

 

revarooo
Level 6
Employee

Yes it does, 7th field!

media   media   robot   robot   robot   side/   ret      size         status/
 ID        type     type    #         slot     face    level  KBytes     multiplexed

 

 

mph999
Level 6
Employee Accredited

Revaroo beat me to showing the headers, but here is the output with a tape :

 

media   media   robot   robot   robot   side/   ret    size     status/
 ID     type    type      #     slot    face    level  KBytes    multiplexed
----------------------------------------------------------------------------
CatalogBackup pool

DataStore pool

NetBackup pool

TAPE01   HCART  NONE      -        -      -       1        704     ACTIVE

 

So we see that TAPE01 is in the NetBackup pool and has a retentionlevel of 1.

tollboy
Level 4

Got it, Thanks!

I wil lhave to write something again to list grab the tapes from the pool contians dup in their name. It will need some post processing.  I checked the available_media script and it is also using bpmedialist and vmquery.

 

Regards

quebek
Moderator
Moderator
   VIP    Certified

Hey

Please try with bpmedialist -l - this is similar report to the one in gui called "tape lists" under NetBackup Management/Reports/Tape Reports.

bpmedialist -l is having such columns - in bold are the two you are interested with:

media id
■ partner id
■ version
■ density
■ time allocated
■ time last written
■ time of expiration
■ time last read
■ Kbytes

■ nimages
■ vimages (unexpired images)
■ retention level
volume pool
■ number of restores
■ status (described previously)
■ hsize
■ ssize
■ l_offset
■ reserved
■ psize
■ reserved
■ four reserved fields

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

Have another look - volume pool is part of 'bpmedialist -l' output. 

Field 13 is the pool number.

tollboy
Level 4

Yeap I already used this command (Shown in OP), I need volume pool as well.

 

Edit: I see you have mentioned Volume pool. My bad.

tollboy
Level 4

Yes it is there in "bpmedialist -l". Can somehow we list those pool id  with their name?

Else I will again have to use 3 commands again.

I have to this every week, when it is not a quaterly/Full week

Get the list of all the tapes which are in the library, retention less then 9 and in any dup pool. We have 5-6 dup pool in different different servers. I am trying to script this task.