[NTLUG:Discuss] Need a little more elbow room.
Steve Baker
sjbaker1 at airmail.net
Wed Dec 15 23:05:47 CST 1999
Tom McDonald wrote:
> If you want to copy a dir tree from one filesystem
> to another, you might try something like --
>
> #cd /
> #find copydir -print } cpio -pdluam /newsys
>
> This will copy all files, directories, and links,
> even the special files. You will get errors on
> the attempt to copy the hard links across the
> filesystems of course, and may have to do some
> clean up by hand.
...or the time-honored:
cd from_dir ; tar cf - * | ( cd to_dir ; tar xvf - )
...do it as root...it won't do '/dev/*' or '/proc' or other
'weird' file types) - but it handles both hard and symbolic
links OK.
(This makes a 'tape archive' of the 'from_dir' directory and
restores it into the 'to_dir' directory - all without using an
actual tape drive! Since 'tar' was designed for backing up
and restoring file systems, it has all the right properties for
this sort of operation.)
You'll probably want to RTFM the 'tar' manual carefully to
be sure you get all the copy options you really need...but
the basic set seem to work OK for me.
--
Steve Baker http://web2.airmail.net/sjbaker1
sjbaker1 at airmail.net (home) http://www.woodsoup.org/~sbaker
sjbaker at hti.com (work)
More information about the Discuss
mailing list