LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Help restoring from tape and tar...... (https://www.linuxquestions.org/questions/linux-software-2/help-restoring-from-tape-and-tar-147111/)

TheDirtyPenguin 02-17-2004 06:43 AM

Help restoring from tape and tar......
 
Hi Folks,

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?

Any ideas?

Thanks

Bryan :cool:

homey 02-17-2004 07:42 AM

Your logs method look pretty enough but I don't see anything that looks like a name for the actual tar file. :(

Here's my example. I'm using the current date as the filename with an extension of tar.gz. Now that is going to another hard drive so I gunzip it ( gz ) but since you are saving to a tape, you shouldn't need the gz.

#!/bin/bash
filename=`date '+%m%d%y'`
tar -cvzf /mnt/backup/${filename}.tar.gz /home
#Delete old files with the following command
find /mnt/backup -type f -name '*.gz' -mtime +90 -exec rm {} \;


All times are GMT -5. The time now is 09:30 AM.