Copy EVERYTHING

Cameron Simpson cs at zip.com.au
Tue Dec 5 21:49:17 UTC 2006


On 05Dec2006 15:54, joe at illegal-access.de <joe at illegal-access.de> wrote:
| >> On Tue, 2006-12-05 at 10:18 +0800, Hadders wrote:
| >> >  > cd /oldpart;  find . -xdev | cpio -padm /newpart
| >The cpio command doesn't preserve the timestamp on directories.

Who cares? Directory timestamps change all the time:-)

| >The tar version does:
| >cd /oldpart
| >tar cvf - . | ( cd /newpart ; tar xf -)
| 
| I thought, that a "cp -a" would do the same....

True. But a pair of cpios or tars pipes together is faster.
And "cp -a" almost certainly breaks hard links. You'd start with one
file with two names in the original and end up with two separate files
in the copy. Ugh.

BTW, if using "rsync -a", make sure you add "-H" as well; -a does not
include it.
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

Heaven could change from chocolate to vanilla without violating perfection.
        - arromdee at jyusenkyou.cs.jhu.edu (Ken Arromdee)




More information about the fedora-list mailing list