cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a command or script to get the no of mounts for each tape

Prasad_V
Level 3
Is there a command or script to get the no of mounts for each tape and also to tell how old is this tape from the time of initial use. I am looking for cui than gui. I appreciate all your help
4 REPLIES 4

Darren_Dunham
Level 6
Number of mounts is one of the parameters that can be reported with 'vmquery'.  The default output has that on a line by itself for a particular tape..

Also in the output is the "creation" date.  That's when this entry appeared in the media database.  It may not be the first time the tape was used, but it's the oldest piece of information that NetBackup has about the tape.

'vmquery' has a few alternate output formats that may work better for parsing by a script, depending on what you're doing.

If the volume is deleted from the volume database, then this information is lost and will be created new if the volume is seen again.  Normally that's not a problem, but I did have one client that routinely deleted old tapes rather than let them remain in the database.

--
Darren

Prasad_V
Level 3
thats true vmquery has all the info I am looking for. but is there a way to get this info for all the media using single command or script is the only other way.
 
Thanks in advance

Rakesh_Khandelw
Level 6
For all media  -

vmquery -w -a |awk '{print $1, $15}'

For specific media -

vmquery -w -m <media_id> | awk '{print $1, $15}'

Prasad_V
Level 3
Thanks Rakesh... that helps.