3 # Bacula interface to mtx autoloader
5 # This mtx-changer script was contributed by Fryderyk Wlostowski.
6 # It works with a Sony TLS-11000 changer, which needs
7 # the slot number to do an unload
9 # mtx-changer "changer-device" "command" "slot"
12 MTX=/opt/mtx1.2.17/sbin/mtx
15 # echo "Doing mtx -f $1 $2"
16 NR_KASETY=`$MTX -f $1 status | grep "Empty" | tr " " "~" | tr ":" "~" | cut -d "~" -f 9`
17 $MTX -f $1 $2 $NR_KASETY
21 # echo "Doing mtx -f $1 $2 $3"
26 # echo "Requested list"
27 $MTX -f $1 status | grep "^[ ]*Storage Element [0-9]*:.*Full" | awk "{print \$3}" | sed "s/:.*$/ /g" | tr -d "[\r\n]"
31 # echo "Request loaded"
32 $MTX -f $1 status | grep "Empty" | tr " " "~" | tr ":" "~" | cut -d "~" -f 9
37 # echo "Request slots"
38 $MTX -f $1 status | grep "[ ]Storage Changer" | awk "{print \$5}"