[comp.unix.questions] cpio

pjh@mccc.UUCP (Peter J. Holsberg) (05/07/88)

Do cpio and ctccpio always overwrite anything that is already on the
diskette or tape?  If so, is there any 'copy' program that does not?
Thanks.

karish@denali.stanford.edu (karish) (05/07/88)

In article <625@mccc.UUCP> pjh@mccc.UUCP (Peter J. Holsberg) writes:
>
>Do cpio and ctccpio always overwrite anything that is already on the
>diskette or tape?  If so, is there any 'copy' program that does not?
>Thanks.

cpio only overwrites what's on a tape if you tell it to.  If you
use a no-rewind tape special device, and space to the end of the
previous file first, you can write a second file onto the tape
after the first one.  On BSD systems, the `mt' utility lets you
reposition the tape.  The comparable AIX command is `tctl'.  I
don't know whether this is a standard SysV command.  Of course,
you have to remember that there are two files on the tape when you
extract data.

It's harder to do this on diskettes.  Piping cpio to dd might do
the trick, if you specify one of the `skip' options to dd.

The tar command will append to an archive, if you use the 'r' flag.  
This is usable for incremental backups.  The disadvantage is
that it's impossible to extract earlier versions of files from the
archive; the tape is read in order, and later versions overwrite
earlier ones on extraction.

Chuck Karish		ARPA:	karish@denali.stanford.edu
			BITNET:	karish%denali@forsythe.stanford.edu
			UUCP:	{decvax,hplabs!hpda}!mindcrf!karish
			paper:	1825 California St. #5
				Mountain View, CA  94041

wnp@killer.UUCP (Wolf Paul) (05/09/88)

In article <625@mccc.UUCP> pjh@mccc.UUCP (Peter J. Holsberg) writes:
>
>Do cpio and ctccpio always overwrite anything that is already on the
>diskette or tape?  If so, is there any 'copy' program that does not?
>Thanks.

Cpio and things like tar don't check to see if there is data; you need to keep
track of what's on the medium you're using.

Most tape drivers call a single contiguous recording of data a "volume"
or (BSD4.2) a "file system"; most drivers come with a user command to
position the tape after a specified volume or file system (i.e. BSD4.2
the command is "fsf").

If your driver does not support this, or if you are using disks, you can
somehow keep track of how much data is on a given disk or tape and then
use some kind of "skipping" filter to write your cpio output. There was
such a program posted to comp.sources.misc a few months ago, I think
it was called "bundle".

Basically such a program opens the device in read/write mode, and reads
or seeks the specified number of bytes before writing its standard input
to its standard output.
-- 
Wolf N. Paul * 3387 Sam Rayburn Run * Carrollton TX 75007 * (214) 306-9101
UUCP:  ihnp4!killer!dcs!wnp                    ESL: 62832882
INTERNET: wnp@DESEES.DAS.NET or wnp@dcs.UUCP   TLX: 910-280-0585 EES PLANO UD

ramesh@ucc386.UUCP (ramesh) (12/01/90)

-- 
                           UNIX is everything.
                           om om om om om om 

ramesh@ucc386.UUCP (12/01/90)

hi

ramesh@ucc386.UUCP (ramesh) (12/03/90)

SUBJECT: Restoring backup off a DAT tape drive using cpio over the network.

       I have two systems, one HP Vectra 486 running SCO Unix and one
HP 370 Series 9000 running HP Unix. Does anyone know how to recover files
from a DAT tape drive across the network to the HP Vectra 486 using the 
cpio command. I would like to perform this command from the HP Vectra 486.
I do not want to copy files from the DAT tape drive to the HP 370 & then
to the HP Vectra 486. I would like to execute one command using cpio
from the HP Vectra 486 to recover files directly from the DAT tape drive
on the HP 370 and put them on back on the HP Vectra 486. If there are any
scripts available, please post a response or send mail directly to me.

Thanks, 
          Gregg        (Email: machovec@ucc386.uunet)
-- 
                           UNIX is everything.
                           om om om om om om