LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Bamboozled by backup! (https://www.linuxquestions.org/questions/linux-general-1/bamboozled-by-backup-37153/)

bimble 12-03-2002 02:13 AM

Bamboozled by backup!
 
I am having a problem with unattended backup.

(Please also see ../Linux-Hardware/'trouble with tape')

I use a Seagate Travan tape to backup a Linux box (Debian 2.2.x). The script I run is(#! etc omitted, paths simplified):

/bin/touch /tmp/backup.start [timestamp start]
/bin/tar -cvf /dev/tape /working/data [tar data to tape]
/bin/mt rewind [rewind tape]
/bin/touch /tmp/backup.finish [timestamp finish]

this is crontab'd to run at 23:30 mon-fri.

If I run the script from the command prompt (like I am right now!) it works fine. When the script runs from crontab it get to about 1/2 way through the data and stops.

Any pointers?

Mik 12-03-2002 02:48 AM

Seems kinda weird but it's probably either differences in user running the script or the environment in which it's run. When you run it from the command prompt what user do you run it as? I assume it's run as root when you run as cron. Root will always have permission to access any of the local files but if you have NFS mounts or other remote mounts in that directory tree then root might not have permission to access the files.
If that doesn't work you could try redirecting the output of the tar command to a file to see if tar is reporting any errors. By the way if you use the rewind device ex. /dev/st0 then the tape will automatically rewind after it's done with the command so it won't be necessary to add the rewind command.
If that still doesn't get you any further then you should start looking at the differences in environment and see if that is causing any troubles. You could add a line like this to the beginning of the script:
/usr/bin/env &> env.output

bimble 12-03-2002 02:56 AM

The data I'm backing up is on a local hdd partition (hdb6) so no NFS problems.

I'll put some output redirects in and see what I get, thanks.

bimble 12-03-2002 03:42 AM

More info:

tar -tf /dev/tape gets part way through the catalogue and tell me the tar file has an unexpected eof - not a huge shock if the tar -c was aborted.

At this point mt tell give me block 2,500,000 ish (about 1.25GB) whereas a full backup gets to 9,600,000 (4.8GB)

--
During the unattended tonite I'll log the env and tar o/put


All times are GMT -5. The time now is 05:04 PM.