LinuxQuestions.org
Help answer threads with 0 replies.
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 04-02-2009, 06:23 AM   #1
pooks
LQ Newbie
 
Registered: Apr 2009
Posts: 2

Rep: Reputation: 0
Question adding files to tar archive


I have a requirement to archive files to tape. What I would like to do is issue a tar from several different points in a shell script such that all files sit in a single archive file on tape. I would have anticipated executing the following commands using the norewind tape device would achieve this:

tar cvf /dev/nst0 /directory1/file1.txt
tar rvf /dev/nst0 /directory2/file2.txt
tar rvf /dev/st0 /directory3/file3.txt
However, when verifying what is on the tape I get the following
tar tvf /dev/st0
blah,blah,blah .... /directory1/file1.txt -- only the 1st file

tar tvf /dev/nst0
blah,blah,blah .... /directory1/file1.txt
tar tvf /dev/nst0
no output from this command
tar tvf /dev/nst0
blah,blah,blah .... /directory2/file2.txt
tar tvf /dev/nst0
no output from this command
tar tvf /dev/nst0
blah,blah,blah .... /directory3/file3.txt

This suggests that 3 archive sets were written. Can someone explain what is wrong ?
 
Old 04-02-2009, 06:34 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,805

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
Try using the -A option instead of -r. Does the append to archive still not work?
 
Old 04-02-2009, 06:39 AM   #3
maxy7710
Member
 
Registered: Jan 2008
Location: Mumbai, india
Distribution: REDHAT, FEDORA,SUSE, UBUNTU, ORACLE ENTERPRISE LINUX & SOLARIS 10
Posts: 130

Rep: Reputation: 17
Once u make a tar archieve, the best way to add or remove files from archive is " cpio ".

do man cpio for further options

i hope this helps
 
Old 04-02-2009, 07:08 AM   #4
pooks
LQ Newbie
 
Registered: Apr 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Question

From documentation tar -A will concatenate tar archives and gives an error. My requirement is really quite simple, save files to tape, do some processing save more files at the end of the tape, so they can all be recovered in a single restore. At the moment, cpio, dd et al cannot be considered.
 
  


Reply


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
Piping tar bzcat to add a file to a tar.bz2 archive DaveQB Linux - Software 0 06-02-2008 09:28 PM
adding multiple files to jar archive drkstr Linux - Software 2 12-26-2006 08:54 PM
Recovering files from corrupt TAR archive... johnwyles Linux - Software 8 04-17-2006 05:44 AM
show biggest files in tar archive? ahz10 Linux - Software 3 11-04-2005 04:48 PM
How to list the files in my tar.bz2 archive ??? merlin23 Linux - Newbie 13 12-14-2004 09:50 AM


All times are GMT -5. The time now is 02:25 AM.

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