LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-03-2002, 02:13 AM   #1
bimble
Member
 
Registered: Dec 2001
Location: Chester, GBR
Distribution: Mostly Ubuntu
Posts: 48

Rep: Reputation: 15
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?

Last edited by bimble; 12-04-2002 at 01:58 AM.
 
Old 12-03-2002, 02:48 AM   #2
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
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
 
Old 12-03-2002, 02:56 AM   #3
bimble
Member
 
Registered: Dec 2001
Location: Chester, GBR
Distribution: Mostly Ubuntu
Posts: 48

Original Poster
Rep: Reputation: 15
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.
 
Old 12-03-2002, 03:42 AM   #4
bimble
Member
 
Registered: Dec 2001
Location: Chester, GBR
Distribution: Mostly Ubuntu
Posts: 48

Original Poster
Rep: Reputation: 15
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can I backup a root disk and boot from the new backup disk linuxbkp Linux - Enterprise 3 10-15-2004 06:42 PM
Selective backup to CDRW, or other backup methods. trekk Linux - Software 1 11-03-2003 02:46 PM
what to backup and how to backup? jolly Linux - General 8 05-08-2003 02:43 AM
Backup asommer Linux - General 3 03-13-2003 04:39 PM
backup and update the backup file doris Linux - General 4 08-24-2002 07:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration