Screencasts - Hilfsvideos

How to check status of multiple medias using vmquery?

Created: 29 Nov. 2012 • Aktualisiert: 01 Dez. 2012 | 7 Kommentare
Dieses Problem wurde gelöst. Siehe Lösung.

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

Kommentare KommentareZum neuesten Kommentar

das Bild der revarooos

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

das Bild der rahul466s

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 :-(

das Bild der Andy Welburns

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
LÖSUNG
das Bild der Will Restores

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

das Bild der rahul466s

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

das Bild der Will Restores

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