lkml.org 
[lkml]   [1996]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Duplicating a file system
Date
From
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.
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!


\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.052 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site