Ignoring parts of stat(2)

Matthias Schniedermeyer ms at citd.de
Tue Jan 5 03:53:44 MST 2010


On 05.01.2010 05:36, grarpamp wrote:
> >  That option can be easily missed it's: --size-only
> 
> That seems like at least part of what would be useful :)
> Certainly it covers the most common case of modtimes.
> 
> However, it doesn't seem to work :(
> 
> cp -p /etc/passwd a
> cp -p /etc/passwd b
> 
> ls -liT a b
> 5 -rw-r--r--  1 user wheel  1706 Dec 25 03:08:02 2009 a
> 6 -rw-r--r--  1 user wheel  1706 Dec 25 03:08:02 2009 b
> 
> touch a
> 
> ls -liT a b
> 5 -rw-r--r--  1 user wheel  1706 Jan  5 05:24:17 2010 a
> 6 -rw-r--r--  1 user wheel  1706 Dec 25 03:08:02 2009 b
> 
> rsync -Haxi --delete --size-only ./a ./b
> .f..t...... a
> 
> ls -liT a b
> 5 -rw-r--r--  1 user wheel  1706 Jan  5 05:24:17 2010 a
> 6 -rw-r--r--  1 user wheel  1706 Jan  5 05:24:17 2010 b

rsync always updates the meta-data, even for files that it doesn't 
transfer.

See:
chmod 777 a
rsync -Haxi --delete --size-only ./a ./b


AFAICT from the man-page there is nothing you can do about that without 
other drawbacks like don't synchronizing the mtime at all.
(See the replacement-list of options for "-a" and skip "-t")




Bis denn

-- 
Real Programmers consider "what you see is what you get" to be just as 
bad a concept in Text Editors as it is in women. No, the Real Programmer
wants a "you asked for it, you got it" text editor -- complicated, 
cryptic, powerful, unforgiving, dangerous.



More information about the rsync mailing list