截屏视频帮助
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

How to check status of multiple medias using vmquery?

创建时间: 29 11 月 2012 • Updated: 01 12 月 2012 | 7 条评论
此问题已解决。 请查看解决方案。

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

评论 条评论跳转至最新评论

revaroo 的图片

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 的图片

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 的图片

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
解决方案
Will Restore 的图片

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 的图片

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 的图片

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