[comp.unix.wizards] Help with tar

gshapiro@wpi.wpi.edu (Gregory N. Shapiro) (05/03/89)

I am trying to make a tape archive of a directory and a file using tar
on an Encore MultiMax.  The first part comes out successful:

tar c -C /usr1 gshapiro

That dumps everything in my directory to tape.  The second part is
where I have trouble.  I want to add to that archive a single file
(/usr/spool/mail/gshapiro).  I have tried the following with no luck:

tar r -C /usr/spool/mail gshapiro
tar r /usr/spool/mail/gshapiro
tar u -C /usr/spool/mail gshapiro
tar u /usr/spool/mail/gshapiro


Does anyone have any suggestions???

					Thanks,

						Greg

 ____________________________________________________________________________

 Gregory Shapiro                                              Gregory Shapiro
 Worcester Polytechnic Institute              Worcester Polytechnic Institute
 GSHAPIRO@WPI.BITNET                                                 Box 1397
 GSHAPIRO@WPI.WPI.EDU (130.215.24.1)                       100 Institute Road
 GEnie: THE.CYCLOPS                            Worcester, Massachusetts 01609
 MacNet: GShapiro                                               United States
 ____________________________________________________________________________

larry@macom1.UUCP (Larry Taborek) (05/05/89)

From article <2175@wpi.wpi.edu>, by gshapiro@wpi.wpi.edu (Gregory N. Shapiro):
> I am trying to make a tape archive of a directory and a file using tar
> on an Encore MultiMax.  The first part comes out successful:
> 
> tar c -C /usr1 gshapiro
> 
> That dumps everything in my directory to tape.  The second part is
> where I have trouble.  I want to add to that archive a single file
> (/usr/spool/mail/gshapiro).

[examples of what he's tried]

Greg,

Some Unix's have tar's that are not capable of adding a file to a
tar archive.

Most unixes CAN put multiple tar's on the same tape.  What you
have to do is use the no-rewind device driver, so that after you
put on a archive, the tape drive doesn't rewind, and then you can
put on the next tar archive.

lets say that ct0 is your tape driver.  If so, then nct0 would be
the No-rewind tape driver.  To put on your origional archive you
would type:

tar -cf /dev/nct0 gshapiro

Then to add another tar archive to the tape:

tar -cvf /dev/ct0 /usr/spool/mail/gshapiro

Notice that the ct0 tape driver is used the last time to rewind
the tape on completion.  Now to extract the first archive, just
do the same as you would normally.  To extract the second tape
archive you would type.

tar -tvf /dev/nct0 

And then:

tar -xvf /dev/ct0

To extract the second.  Note that this does not add to a tape
archive, but instead puts a second tape archive after the first.
You can use this technique to put many tape archives on a single
tape.

Hope that helps

-- 
Larry Taborek	..!uunet!grebyn!macom1!larry	Centel Federal Systems
		larry@macom1.UUCP		11400 Commerce Park Drive
						Reston, VA 22091-1506
						703-758-7000

dente@els.uucp (Colin Dente) (05/05/89)

In article <4848@macom1.UUCP> larry@macom1.UUCP (Larry Taborek) writes:
>From article <2175@wpi.wpi.edu>, by gshapiro@wpi.wpi.edu (Gregory N. Shapiro):
>> I am trying to make a tape archive of a directory and a file using tar
>> on an Encore MultiMax.  The first part comes out successful:
[...stuff deleted...]

>lets say that ct0 is your tape driver.  If so, then nct0 would be
>the No-rewind tape driver.  To put on your origional archive you
>would type:
>
>tar -cf /dev/nct0 gshapiro
>
>Then to add another tar archive to the tape:
>
>tar -cvf /dev/ct0 /usr/spool/mail/gshapiro
From the gist of the original article, I get the impression that Greg
was talking about adding new files to the tape at different times, so
it would be a good idea to make sure you step the tape past the first
file before writing the second!

Whilst you could do the tar tvf /dev/nct0 that Larry suggests for
extracting the second file, it would be much neater (and quicker?) to
use mt to control the tape drive.  i.e. to writ the second file:

mt -f /dev/nct0 fsf1 ;           # Steps tape over first file
tar cvf /dev/ct0 /usr/spool/... ;# write the second file

And then to extract the second file, just do what Larry said, but use
mt again.
>
>Note that this does not add to a tape
>archive, but instead puts a second tape archive after the first.
Indeed, and vey messy it can get.  Why, oh why can't I rely on tar
being able to append to a file?

Ho hum

Colin


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| Colin Dente                      | JANET: dente@uk.ac.man.ee.els            |
| Dept. of Electrical Engineering  | ARPA:  dente@els.ee.man.ac.uk            |
| University of Manchester         | UUCP:  ...!mcvax!ukc!man.ee.els!dente    |
| England                          | These might work now, but then again...  |
|-----------------------------------------------------------------------------|
|   Well I know how to behave in the restaurant now,                          |
|   I don't tear at the meat with my hands.       ....Well, not always....    |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=