begin  quoting Ralph Shumaker as of Wed, Sep 21, 2005 at 07:48:37PM -0700:
> As suggested by some on the list, I tried cpio for copying whole 
> partitions (not to mention using dd) and parts of partitions.  I did not 
> find it any better than cp with the appropriate switches, but in fact worse.

Interesting!

> So far, I like cp the best.  But there is primarily one thing that I do 
> *not* like.  It doesn't keep the timestamps of links.  I tried touching 

What options are you passing to cp?

> a few of the destination links after the copy, but instead of the links' 
> timestamps changing, the timestamps were changed on the files to which 
> they link.
> 
> The simplest way that I can think of to verify all files copied over is 
> to "ll -aR > ll-aR.hde2" and "ll -aR > ll-aR.hdg2" and then "diff 
> ll-aR.hde2 ll-aR.hdg2 > ll-aR.hdg2-hda2.diff", but every link shows up 

Er, what's the ll business? That's a common alias for "ls -l", but it's
not a standard command on any of my Linux boxen.

> there because of the timestamp.  And there are a whole *lotta* links.  I 
> can pipe through a 'grep -v " --> "' and get a much smaller output.  And 
> although this assures me that the objects of the links copied fine, it 
> eliminates the certainty that all *links* got copied.  Is there a way to 
> make cp keep the timestamps of the copied links?  As far as I can tell, 
> any attempt to modify the timestamp of the link just gets applied to its 
> target.

What if the target isn't there?

mv $target $target.__save__
touch $link blah blah blah
mv $target.__save__ $target

> The other thing that is disconcerting about the cp, ll, diff I do is 
> that directory sizes don't necessarily stay the same.  If the size 
> differs at all, usually the copy is taking less space.  (I don't 
> remember seeing any that ended taking more.)  But this occurrence is 
> much, much less frequent than the link dates changing.

Yes, that's expected.
 
> Is there a way to get a reliable listing of the source files, do a byte 
> for byte comparison, and report only the ones that are different?

Isn't that what the cmp command does?

-Stewart "Never thought about looking at a link's timestamp before" Stremler


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to