11-29-2012 07:09 AM
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
Solved! Go to Solution.
11-30-2012 01:58 AM
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
11-29-2012 07:24 AM
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
11-29-2012 07:44 AM
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 :(
11-29-2012 07:46 AM
assuming your robot number is 0
vmquery -b -rn 0
will show all media in the library
11-29-2012 07:49 AM
Yes but i have a list of 100 medias that i need to check whether those medias are inside the library or not?
11-29-2012 07:53 AM
understood. just another way to 'skin the cat'
if it's on the vmquery output, it's in the library, otherwise it's not
11-30-2012 01:58 AM
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
12-01-2012 08:41 PM
Thanks Andy...it worked :)