Video Screencast Help
Protect Your POS Environment Against Retail Data Breaches. Learn More.

How to check status of multiple medias using vmquery?

Created: 29 Nov 2012 • Updated: 01 Dec 2012 | 7 comments
This issue has been solved. See solution.

Hi All,

I have a list of 100+ medias that i need to check whether they are in library or not.

is there any script or command that i can use to see the status of  all the medias in a go.

 

Thanks in advance

Comments 7 CommentsJump to latest comment

revaroo's picture

Depends. Is your OS Unix?

Assuming your list is like this in the file:

A00001

A00002

A00003 

etc you could use:

 

for tapes in `cat filename`

do

vmquery -m $tapes

done

 

rahul466's picture

Thanks revaroo for your reply.

OS is unix

the media list is located in /usr/openv/netbackup/vault.. by the name eject.list

and i have to run the command under the path /usr/openv/volmgr/bin?

 

Please let me know ..(i have less hands on unix :-(

 

Andy Welburn's picture

Presuming the format of eject.list *is* just a list of media_ids (per revaroos example) then you would 'feed' that into the 'command' given by revaroo - this does *not* have to be run from anywhere specific (most people would just create a small script & run that, but you *can* actually run it 'live' as it were)

e.g. an updated version of revaroos example just run straight from the command line/prompt on a line by line basis - personally I would save the whole lot as a file & run that

#  for TAPE in `cat /path_to_list_of_media/tapes.lst`
>  do
>  ROBOT=`vmquery -m $TAPE | grep "robot type"|awk '{print $3}'`
>  case $ROBOT in
>          NONE) echo "Media $TAPE is NOT in library"
>          ;;
>          *) echo "Media $TAPE is in $ROBOT"
>          ;;
>  esac
>  done
Media 300184 is in TLD
Media 300726 is in TLD
Media 300625 is NOT in library
Media 300680 is NOT in library

 

SOLUTION
Will Restore's picture

assuming your robot number is 0

  vmquery -b -rn 0

will show all media in the library

Will Restore -- where there is a Will there is a way

rahul466's picture

Yes but i have a list of 100 medias that i need to check whether those medias are inside the library or not?

Will Restore's picture

understood. just another way to 'skin the cat'

if it's on the vmquery output, it's in the library, otherwise it's not

 

Will Restore -- where there is a Will there is a way