echo"Unloading tapes that could be remaining in the drives from previous runs"
mtx -f /dev/${LIBRARYDEVICE} status
for unload in$(mtx -f /dev/${LIBRARYDEVICE} status | grep'^Data Transfer Element' | grep-vi':empty' | sed-e's/Data Transfer Element /drive/;s/:.*Storage Element /-slot/;s/ .*//');do
# normally, there is no need to rewind with virtual tapes...