Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.3 alpha 4/3/85; site ukma.UUCP
Path: utzoo!watmath!clyde!cbosgd!ukma!david
From: david@ukma.UUCP (David Herron, NPR Lover)
Newsgroups: net.unix-wizards
Subject: Re: tar fs copy
Message-ID: <2226@ukma.UUCP>
Date: Sat, 21-Sep-85 02:09:27 EDT
Article-I.D.: ukma.2226
Posted: Sat Sep 21 02:09:27 1985
Date-Received: Sun, 22-Sep-85 05:40:35 EDT
References: <832@burl.UUCP> <221@drivax.UUCP> <842@burl.UUCP> <240@investor.UUCP> <233@drivax.UUCP> <249@investor.UUCP>
Reply-To: david@ukma.UUCP (David Herron, NPR Lover)
Organization: Univ. of KY Mathematical Sciences
Lines: 46

In article <249@investor.UUCP> rbp@investor.UUCP (Bob Peirce) writes:
>>> following runs fine.
>>> 
>>> if [ $# -ne 2 ]
>>> then
>>> 	echo usage: cphier frompath topath
>>> fi
>>> exec tar cf - $1 | (cd $2; tar xf - )
>> 
>> directory it does a fork/exec of mkdir, then waits for all of its
>> children to die, including the first tar. Now if the first tar is
>> nearly finished then it will write its output to the pipe and exit,
>> which allows the second tar to continue. However, if the first tar
>> has to write more than what will fit in the pipe then the whole mess
>> hangs up, because the first tar is waiting for the second tar to
>> read from the pipe, and the second tar is waiting for the first tar
>> to exit.

huh?  This can't work as you're suggesting.  If so, then the standard
tar pipeline (as documented in tar(1)) wouldn't work at all.

I've often (read, any time I copy directory heirarchies) used that
pipeline, and IT'S JUST WORKED.  This is for both simple directory
trees (one or two levels) all the way to very complicated ones (like,
the System V troff/nroff tree).

Tar HAS to be able to exec mkdir at any time and work correctly.  It
can't be waiting for all it's children to exit like you say.....

By The Way ... I always use the complete form as in:

	(cd $1; tar cf - .) | (cd $2; tar xf -)

but there was this wonderfull shell script posted to net.sources
around last may or so that did all sorts of error checking and
creating of target directories and all.  So that's what I use
instead of doing the above directly.  (Look in your sources archive
for "cpdir(1)").

-- 
--- David Herron
--- ARPA-> ukma!david@ANL-MCS.ARPA
--- UUCP-> {ucbvax,unmvax,boulder,oddjob}!anlams!ukma!david
---        {ihnp4,decvax,ucbvax}!cbosgd!ukma!david

Hackin's in me blood.  My mother was known as Miss Hacker before she married!