Added sleep 120 and then rewind/eject the tape
This commit is contained in:
parent
4d24375593
commit
2ef2e1b0d2
11
autotape.sh
11
autotape.sh
@ -3,7 +3,7 @@
|
|||||||
### Config options ###
|
### Config options ###
|
||||||
BACKUP_DIRS="/home/jake/Documents/wallpapers"
|
BACKUP_DIRS="/home/jake/Documents/wallpapers"
|
||||||
DRIVE="/dev/st0"
|
DRIVE="/dev/st0"
|
||||||
RECHECK_WAIT=30
|
RECHECK_WAIT=1200
|
||||||
MT="/bin/mt"
|
MT="/bin/mt"
|
||||||
TAR="/bin/tar"
|
TAR="/bin/tar"
|
||||||
|
|
||||||
@ -12,9 +12,12 @@ TAR="/bin/tar"
|
|||||||
|
|
||||||
Do_backup()
|
Do_backup()
|
||||||
{
|
{
|
||||||
sleep 10 # Wait for the tape to get ready...
|
sleep 15 # Wait for the tape to get ready...
|
||||||
echo "Doing backup..."
|
echo "Doing backup..."
|
||||||
${TAR} -cf ${DRIVE} ${BACKUP_DIRS}
|
${TAR} -cf ${DRIVE} ${BACKUP_DIRS}
|
||||||
|
echo "Backup done!"
|
||||||
|
sleep 120 #Just in case wait for the tape drive
|
||||||
|
${MT} -f ${DRIVE} offline
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,7 +45,7 @@ TESTTAPE=`${MT} -f ${DRIVE} status | grep DR_OPEN`
|
|||||||
EXIT_STATE=1
|
EXIT_STATE=1
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "Tape seems to be in drive, contiuing"
|
echo "Tape seems to be in the drive, contiuing"
|
||||||
EXIT_STATE=0
|
EXIT_STATE=0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -66,7 +69,7 @@ fi
|
|||||||
# Check if the utils/programs exists
|
# Check if the utils/programs exists
|
||||||
Check_utils
|
Check_utils
|
||||||
|
|
||||||
# Check and repeat until the tape drive is on
|
# Check and repeat until the tape drive is on/connected
|
||||||
EXIT_STATE=3
|
EXIT_STATE=3
|
||||||
while [ ${EXIT_STATE} != 0 ]; do
|
while [ ${EXIT_STATE} != 0 ]; do
|
||||||
Check_drive
|
Check_drive
|
||||||
|
Loading…
x
Reference in New Issue
Block a user