Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Script to suggest tape-library drives order and Bacula Configuration
- # Requires sg3_utils and lsscsi (yum -y install sg3_utils lsscsi)
- # http://bacula.us
- byidpath=/dev/tape/by-id/
- chnum=0 && for j in $(ls -la $byidpath* |grep sg | cut -f 5,7 -d "/" | sed 's/ /,/g' | cut -d "," -f 1)
- do
- echo -ne "Autochanger $((chnum++))\t"
- echo "
- Changer Device = $byidpath$j
- "
- done
- drnum=0 && for i in $(ls -la $byidpath* |grep /nst |cut -f 5,7 -d "/" | sed 's/ /,/g' | cut -d ',' -f 1,3)
- do
- static=$(echo $i | cut -f 1 -d ',')
- stpath=$(echo $i | cut -f 2 -d ',' | cut -f 2 -d '/' | cut -c 2-)
- echo "Drive $(lsscsi -g | grep -e tape -e $stpath | cut -d "]" -f 2| grep $stpath | sed "s/^[ \t]*//")"
- echo "$(sginfo -s $byidpath$static)"
- echo " Drive Index = $((drnum++))"
- echo " Archive Device = $byidpath$static
- "
- done
Advertisement
Add Comment
Please, Sign In to add comment