rsync -a --update resets status of newer target directories

Matthias Schniedermeyer ms at
Tue Jan 21 15:14:47 MST 2014

On 21.01.2014 10:07, Linda Walsh wrote:

Wow. Your E-Mail is quite an unreadable HTML mess.

> Then how does "-u" work with files?  If what you say is true, then 
> how would you preserve a newer mtime on the files on the target?

> That is what "-u" does.  Yet you claim this is impossible because
> it isn't unidirectional?

There is a thing called "special case".

Only because there is a "special case" doesn't mean that the general 
description is invalid.

And frankly i didn't think of -u at the time, as it is one of those 
obscure "only for special cases" parameters that has such a narrow 
use-case that i personally found no use for it. Same goes for quite a 
few of the other "special case" parameters.

And -u is evalutated in list-mode, so it just skips over the files. Once 
you get to transfer-mode it's all about difference, which is the point 
where rsync changes the directory time when it was different. There is a 
slight difference for directories, you still have to enter them, you 
can't just skip over them (Of course assuming running in standard 
recursive mode).

You could say the OPs problem is that there isn't a equivalent option to 
do the same for directories, or that directories are excluded (Which OP 
said what was unexpected). Although i don't know enough about rsyncs 
inner workings to know if rsync can skip adding a directory into the 
transfer-list while still entering the directory, but as the OP send a 
patch later i guess it is.



More information about the rsync mailing list