04-21-2014 08:23 AM
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
Solved! Go to Solution.
04-21-2014 12:27 PM
Try the available_media script.
I think this is in the netbackup/goodies dir from memory.
Martin
04-21-2014 12:27 PM
Try the available_media script.
I think this is in the netbackup/goodies dir from memory.
Martin
04-22-2014 02:56 AM
Martin,
Thanks for the reponse. But available media script does not give retention level of the tape.
Regards,
04-22-2014 04:08 AM
It does ...
04-22-2014 04:26 AM
Yes it does, 7th field!
media media robot robot robot side/ ret size status/
ID type type # slot face level KBytes multiplexed
04-22-2014 05:51 AM
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.
04-22-2014 06:10 AM
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
04-22-2014 06:26 AM
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
04-22-2014 06:35 AM
Have another look - volume pool is part of 'bpmedialist -l' output.
Field 13 is the pool number.
04-22-2014 07:24 AM
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.
04-22-2014 07:32 AM
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.