cancel
Showing results for 
Search instead for 
Did you mean: 

List media ID status

crscsy
Level 3

Hello all,

     I have been given a list of media IDs to verify. Is there a way to do this other than one by one using vmquery?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified
You can list one tape or all tapes.
If you list all tapes and save output in a text file, it might be easier to search the text file.
Run:
vmquery -a -bx

View solution in original post

5 REPLIES 5

sclind
Moderator
Moderator
   VIP   

What are you trying to find out?

So when I run vmquery -m <media id> I get the status of that ID or I recieve that the ID cannot be found.

What I am trying to do is figure out a way to do this with multiple media IDs from a list and have the results piped to a text file

 

sclind
Moderator
Moderator
   VIP   

Sort of like this perhaps?

In whatever shell you use read the input file of media IDs.  While not end of file run vmquery against each one.  The entire output of the while loop can then be piped out to an output file:

cat \tmp\inputfile | while read tape ; do
  vmquery -m $tape
done > \tmp\outfile.txt

 

 

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified
You can list one tape or all tapes.
If you list all tapes and save output in a text file, it might be easier to search the text file.
Run:
vmquery -a -bx

Thank you both for the posible solutions!

I have run Marianne's idea and am running a compair against the list I was given this should hopefully get me the results I was looking for

 

Again thank you!