MTX=@MTX@
+#
+# The purpose of this function to wait a maximum
+# time for the drive. It will
+# return as soon as the drive is ready, or after
+# waiting a maximum of 180 seconds.
+# Note, this is very system dependent, so if you are
+# not running on Linux, you will probably need to
+# re-write it.
+#
+# If you have a FreeBSD system, you might want to change
+# the $(seq 180) to $(jot 180) -- tip from Brian McDonald
+#
wait_for_drive() {
- while ! mt -f $1 status >/dev/null 2>&1; do
+ for i in $(seq 180); do # Wait max 180 seconds
+ if mt -f $1 status >/dev/null 2>&1; then
+ break
+ fi
# echo "Device $1 - not ready, retrying..."
- sleep 5
+ sleep 1
done
}
${MTX} -f $ctl status | grep " *Storage Element [0-9]*:.*Full" | awk "{print \$3 \$4}" | sed "s/Full *\(:VolumeTag=\)*//"
# Comment out the previous line and add a line here
# to print "fake" barcodes.
+#
+# If you have a VXA PacketLoader and the above does not work, try
+# turning it off and enabling the following line.
+# ${MTX} -f $ctl status | grep " *Storage Element [0-9]*:.*Full" | sed "s/*Storage Element //" | sed "s/Full :VolumeTag=//"
;;
loaded)