tar cf - | (cd destdir; tar xvfp - )
Don't forget 'p'reserve, or it won't actually preserve all the file
attributes, etc that you care about. If you are moving stuff with
non-default permissions, you probably care.
Maybe the new linuxy kitchen-sink gtarry stuff does a silent 'p'
by default, dunno.
Eirikur Hallgrimsson wrote:
> [ Extreme shell geekery. Not of any other interest. ]
> I use cp -rauvx as my fallback, but this won't copy hidden files and I've
> not figured out a way to get cp to do that.
> I prefer to use cpbk, "backup copy" which can be found on Freshmeat.
> A really cute hack that I learned from a colleague on this Tru-64 adventure
> is to run two copies of tar piped. This preserves all the file attributes,
> dates, etc, and offers all the features of tar. I turned it into a utility
> shell script thusly:
> # tar $1, pipe to tar and unpack in destination $2
> tar -c $1 | tar -C $2 -xvf -
> If you put that into a file, and make a command alias for it, you get a
> command that takes two directories as arguments and copies the first one (and
> its entire tree) into the second one.
> tarcopy /sourcedir /destdir
> That results in a /destdir/sourcedir that is a the best facsimile of the
> original that I know how to get.
-- ======================================================================== Strata Rose Chalup [KF6NBZ] strata "@" virtual.net VirtualNet Consulting http://www.virtual.net/ ** Project Management & Architecture for ISP/ASP Systems Integration ** =========================================================================
This archive was generated by hypermail 2b29 : Sun Apr 29 2001 - 20:25:40 PDT