Part of my motivativation for even having a blog – probably my ONLY motivation for having a blog – is to keep all those little usefull things that I know work but keep forgetting about… For instance – I was going to do my cisco journal as an extended blog… some day….
anyway…
if you want to copy data on a *nix machine from one place to the other and preserve permissions, you can do this…
From the source directory…
tar czf – * | (cd /target ; tar xzfp -)
This creates a compressed tar stream from the current directory to the standard input, then changes to the target directory and uncompresses the stream, preserving ownership and permissions into the target directory.
there is an alternative form – not sure if it’s supported by all versions of tar but it runs like this…
tar czf -C/source/ – * | tar xzfp -C/target/ -
where -C says change to directory blah. I need to check the syntax – e.g. absolute versus relative, and if there is a space b/w the C and the name… if in doubt, check ‘man tar’…