[PATCH] Add option --dirs-update

Marian Marinov mm at yuhu.biz
Mon Apr 7 06:22:11 MDT 2014

I'm interested in this patch.
It is useful for situation where you want to do contentious replication of files.

Since I was not in the list by the time you sent those patches, would you please forward them to me?


On 04/07/2014 02:20 PM, Arvid Requate wrote:
> Hello,
> are there any other opinions about the suggested patch?
> It adds an option "--dirs-update", which handles directories in a similar way
> as "--update" handles files. We face a certain situation where this is useful.
> Suggestions to improve the patch are welcome.
> Arvid
> Am Montag, 20. Januar 2014, 16:44:02 schrieb Arvid Requate:
>> Hello,
>> thanks for your comments. Attached you may find a git patch based on the
>> master branch. The patch adds a new rsync option which helps in our use
>> case of replicating Samba 4 sysvol directories. In this specific case
>> fACLs, xattrs and modification timestamps of subfolders of the target can
>> get modified by Windows client tools in between subsequent rsync runs. If
>> this happens, they should not be overwritten to avoid inconsistencies and
>> client side error messages.
>> To achive this, the patch implements an option "--dirs-update" to let rsync
>> skip changes to directories in case the target directory has a more recent
>> modification timestamp than the source directory *and* the direct content of
>> the directories is the same. This option can be regarded as complementary
>> to the existing option "--update", which does pretty much the same for
>> files. The patch also provides a script for the testsuite.
>> Maybe the patch is also useful for others. If it doesn't inflict any
>> collateral damage on the general behaviour of rsync (e.g. the incremental
>> recursion), maybe it would be worthwile to submit it as an enhancement bug
>> to the bugzilla. Any opinions about this or suggestions for imrovement?
>> On 16.01.2014 01:31:38, Matthias Schniedermeyer wrote:
>>> - rsync doesn't determine if atime/mtime is bigger/smaller, it only
>>> determines if they are identical or not.
>>  From looking at the function cmp_time in util.c and its use in generator.c I
>> obtained the impression that time ordering is explicitely considered. My
>> patch makes use of this function. Also the description of the option
>> "--update" in the manual page ("skip files that are newer") seems to
>> support this impression.
>> I'm aware of the unidirectional nature of rsync you pointed out. We use
>> rsync to let two machines pull the content of a certain directory tree and
>> let them take turns at that. Modification time ordering is essential for
>> this. Since Samba doesn't implement DFS replication yet we have to rely on
>> this.
>> Cheers,
>> Arvid

More information about the rsync mailing list