Here is a script that will scan all media marked as FOREIGN
说明
We are requested to supply a script that would Scan all media that is marked as FOREIGN in a specific tape library
原因
If you have many tapes marked as FOREIGN and do not want to use the NV GUI to scan the tapes one by one, sometimes, using a script is more effective.
解决办法
for x in `/usr/netvault/util/nvlistmedia -libraryname 'Tape-Library-Name' -needsimport | sed -n 's/.*(\([^)][^)]*\)).*/\1/p'`; do /usr/netvault/util/nvscanmedia -wait -barcode $x; done
其他信息
Plese modify the script to correspond to the correct Tape-Library-Name and the location where the %netvault%/util is located on your server on your server.
The whole script starting on "for "and ending on "done' has to be ONLY ONE LINE, or it will fail.
Please use the script at your own risk as we are not liable for any unintended problems caused by running the script.