Forum Discussion

crscsy's avatar
crscsy
Level 3
7 years ago

List media ID status

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!

  • 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

5 Replies

    • crscsy's avatar
      crscsy
      Level 3

      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's avatar
        sclind
        Level 6

        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