#!/bin/sh #pool="LTO-6-Archiv" pool="LTO-6-Tapes" storage="LTO-6" drive="/dev/tape/by-id/scsi-35000000000000000-nst" #pool="LTO-4-Tapes" #storage="LTO-5" #drive="/dev/tape/by-id/scsi-30000000000000000-nst" if [ $# -gt 0 ]; then tape=$(echo $1 | tr -dc [0-9) if [ "$1" = "$tape" ]; then echo LOAD for i in 1 2 3 4 5; do if mt -f $drive load; then break else sleep 5 fi done echo REWIND mt -f $drive rewind /etc/bareos/tape-helper 1 mam echo WEOF mt -f $drive weof echo LABEL echo label volume=$tape storage=$storage pool=$pool yes | bconsole sleep 2 echo REWOFFL mt -f $drive rewoffl exit 0 else echo "Error, invalid parameter: $1" exit 1 fi fi echo "Recycle tape (bconsole):" echo " purge jobs volume=0200" echo "Load tape:" echo " LTO-4: mt -f /dev/tape/by-id/scsi-30000000000000000-nst load" echo " LTO-6: mt -f /dev/tape/by-id/scsi-35000000000000000-nst load" echo "Rewind tape:" echo " LTO-4: mt -f /dev/tape/by-id/scsi-30000000000000000-nst rewind" echo " LTO-6: mt -f /dev/tape/by-id/scsi-35000000000000000-nst rewind" echo "Erase tape:" echo " LTO-4: mt -f /dev/tape/by-id/scsi-30000000000000000-nst weof" echo " LTO-6: mt -f /dev/tape/by-id/scsi-35000000000000000-nst weof" echo "Label tape:" echo " LTO-4: echo label volume=0001 storage=LTO-5 pool=LTO-4-Tapes yes | bconsole" echo " LTO-6: echo label volume=0100 storage=LTO-6 pool=LTO-6-Tapes yes | bconsole" echo "Eject tape:" echo " LTO-4: mt -f /dev/tape/by-id/scsi-30000000000000000-nst rewoffl" echo " LTO-6: mt -f /dev/tape/by-id/scsi-35000000000000000-nst rewoffl"