Every night I backup a whole load of files to an external tape drive. It took me a while but I came up with this which seems to work:
tar -cvz -b 16384 -X /tmp/excludefile -f /dev/nst0 /var/backup/ > /var/log/backup/tapebackup/backup-`date +%Y%m%d`.log 2>/var/log/backup/tapebackup/backup-`date +%Y%m%d`.log
Anyways, its been about 2 weeks since I've done this and I want to run a test restore.
So I rewind the tape.
And then for example: (a file picked at random)
tar -tv -b 16384 -f /dev/nst0 /var/backup/edwtserv16/arcdata/EPOSD11/import/enable_consts.sql
I know this file exists because I got it from the logs.
Then it returns this for about 20 minutes whilst the tape whirls around in use:
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Archive contains obsolescent base-64 headers
Then I get this:
tar: /var/backup/edwtserv16/arcdata/EPOSD11/import/enable_consts.sql: Not found in archive
tar: Error exit delayed from previous errors
So am I doing something stupid? I dont like the "This does not look like a tar archive" Why is it saying that when it is being created as a tar archive?