Re: Duplicating a file system

Ulrich Windl (Ulrich.Windl@rz.uni-regensburg.de)
Mon, 11 Mar 1996 09:33:12 +0100


On 10 Mar 96 at 12:44, Drew Sullivan wrote:

> In message <Pine.LNX.3.91.960309093124.145A-100000@marvin.mars.org>, Bill Power
> s writes:
> > On Fri, 8 Mar 1996, Joel Young wrote:
> >
> > This will also work: Assuming the partitions are mounted as /From/Dir and
> > /To/Dir:
> >
> > (cd /From/Dir ; tar cf - . ) | (cd /To/Dir ; tar xvfp - )
>
> ***NEVER*** do this use this instead:
> umask 0 # tar honours umask
> (cd /From/Dir && tar clf - . ) | (cd /To/Dir && tar xpf - )
> ^^ ^^
> Note the double &&. If the cd fails then the tar doesn't run.

Usually I wouldn't reply, but why not
(cd /From/Dir && tar clf - . ) | (umask 0 && cd /To/Dir && tar xpf - )
?

Despite of that, doesn't tar ignore the umask when UID == 0?

> Otherwise you have the potential of mangling either the source tree
> or the destination tree.
>
> --
> -- Drew Sullivan, <drew@ss.org> -- Toronto, Canada, +1-416-225-1592
> "Intel Inside" isn't advertising. It's a warning!
>
>