@@ -26,7 +26,7 @@ echo $(date)
2626# Now you should have a tape initialized with `file 0` containing the tarball of your source directories
2727# and `file 1` containing the tar snapshot and the directories.txt file. When the following script is
2828# run, it will first retrieve these index files, use them to generate a new incremental tar and write
29- # the pair to tape.
29+ # the pair to tape.
3030
3131# How to do a backup:
3232# 1. Run this script manually or via cron with no arguments
@@ -68,7 +68,11 @@ fn_backup () {
6868 exit 0
6969 fi
7070 # check for active tape by seeking to end of data and checking the files at the last file
71+ echo " Seeking to end of tape"
7172 mt -f /dev/nst0 eod || ( echo " Can't seek to eod, quitting" && exit 0 )
73+ echo " Current tape status:"
74+ mt -f /dev/nst0 status
75+ echo " Seeking to beginning of last file on tape"
7276 mt -f /dev/nst0 bsfm 2 || ( echo " Can't read the last written file from tape, quitting" && exit 0 )
7377 if tar tvf /dev/nst0 | grep -q " directories.*.txt" ; then
7478 echo " Found the directories list, will read snapshot file and directories from tape"
@@ -97,6 +101,9 @@ fn_backup () {
97101 tar -cvf /dev/nst0 " tape${TAPE_NUMBER} .snar" " directories${TAPE_NUMBER} .txt"
98102 # delete local index files
99103 rm " tape${TAPE_NUMBER} .snar" " directories${TAPE_NUMBER} .txt"
104+ echo " Incremental tar and index files were successfully written to tape ${TAPE_NUMBER} "
105+ echo " Current tape status:"
106+ mt -f /dev/nst0 status
100107}
101108
102109fn_restore () {
0 commit comments