[PATCH] Add option --dirs-update (was: rsync -a --update resets status of newer target directories)
requate at univention.de
Mon Apr 7 05:20:01 MDT 2014
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.
Am Montag, 20. Januar 2014, 16:44:02 schrieb Arvid Requate:
> 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
Dr. Arvid Requate
Open Source Software Engineer
Tel. : +49 421 22232-52
Fax : +49 421 22232-99
requate at univention.de
Geschäftsführer: Peter H. Ganten
HRB 20755 Amtsgericht Bremen
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 9246 bytes
Desc: not available
More information about the rsync