LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-09-2007, 11:19 PM   #1
sonici-aus
LQ Newbie
 
Registered: Jul 2007
Posts: 3

Rep: Reputation: 0
Appending to a tar tape backup


I have a Red Hat Enterprise Linux ES release 4 (Nahant Update 5) system running on HP hardware including a HP Ultrium 448 Internal Tape Drive. All works well, except appending to a tar backup. I use the following command to backup everything on the system except the data2 directory.

cd /
tar --preserve-permissions --exclude-from backup-exclude --same-owner -cf /dev/st0 *

The backup-exclude file contains the following...

proc
tmp
var/log
opt/APC
sys
data2

When the backup completed it verifies correct using
tar -tf /dev/st0

For business reasons I have to backup the data2 directory 10 hours after the initial backup starts... For this backup I use the following...

tar --preserve-permissions --preserve --same-owner -rf /dev/st0 data2/*

When I run the above command I get error messages for every file in the data2 folder saying

tar: data2/44401.dat: Not found in archive

What have I missed?

Regards ... AJ
 
Old 07-10-2007, 01:49 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
I found a couple of items in the tar info manual that might apply:

Code:
   `--append' cannot be performed on some tape drives, unfortunately,
due to deficiencies in the formats those tape drives use.  The archive
must be a valid `tar' archive, or else the results of using this
operation will be unpredictable.  *Note Media::.
Code:
   In order to update an archive, `tar' must be able to backspace the
archive in order to reread or rewrite a record that was just read (or
written).  This is currently possible only on two kinds of files: normal
disk files (or any other file that can be backspaced with `lseek'), and
industry-standard 9-track magnetic tape (or any other kind of tape that
can be backspaced with the `MTIOCTOP' `ioctl'.

   This means that the `--append' (`-r'), `--update' (`-u'),
`--concatenate' (`--catenate', `-A'), and `--delete' commands will not
work on any other kind of file.  Some media simply cannot be
backspaced, which means these commands and options will never be able
to work on them.  These non-backspacing media include pipes and
cartridge tape drives.

   Some other media can be backspaced, and `tar' will work on them once
`tar' is modified to do so.
I don't know if this would apply with your hardware. Could you create another backup on the same tape?

Last edited by jschiwal; 07-10-2007 at 01:53 AM.
 
Old 07-10-2007, 08:34 PM   #3
sonici-aus
LQ Newbie
 
Registered: Jul 2007
Posts: 3

Original Poster
Rep: Reputation: 0
I have been doing some more work on this issue and have found that if the data2 directory is on the tape then the -r option appears to work.

I can't backup the data2 folder because it is likely that some files may be open (which will cause the back up to fail and subsequent tasks not to run).

The real issue is the message

tar: data2/44401.dat: Not found in archive

The message appears next to each file in the data2 folder.
 
Old 07-11-2007, 01:45 AM   #4
sonici-aus
LQ Newbie
 
Registered: Jul 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Sorted!!!

The issue was the --preserve paramater on the command line

tar --preserve-permissions --preserve --same-owner -rf /dev/st0 data2/*

If I use

tar --preserve-permissions --same-owner -rf /dev/st0 data2/*

it works perfectly...

Thanks
 
  


Reply

Tags
backup, tar


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM
tar backup maximum 2gb only per tape tsaravan Linux - General 6 09-20-2006 06:45 AM
Using a DDS5 tape drive to restore from a DDS3 backup tape. AndrewCAtWayofthebit Linux - Hardware 1 05-14-2006 09:15 AM
newbie tar/tape backup questions mattl Fedora 3 04-24-2006 10:07 PM
How to perform appending backup on tape drive. Need urgent help LenkaNguyen Linux - Hardware 2 05-11-2002 08:16 AM


All times are GMT -5. The time now is 05:24 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration