axkibe/lsyncd — Issue #16: Make inotify events configurable
Author: axkibe
Created: 2011-11-16 14:56:44+00:00
State: open

Originally filed by sh2...@gmail.com on 2010-04-10T10:37:57

Lsyncd does not allow the user to configure the triggering inotify events.
Instead lsyncd registers the following events ATTRIB, CLOSE_WRITE, CREATE,
DELETE, DELETE_SELF, MOVED_FROM, MOVED_TO, DONT_FOLLOW, ONLYDIR. In some
use cases this will result in unnecessary sync operations which is in
particular painful if the network bandwidth between source and destination
is an issue.

Given an remote application which puts files in the lsyncd source by
creating a temporary file (CREATE), copy the data (CLOSE_WRITE), moving the
temporary file to the final filename (MOVE_FROM, MOVE_TO). This application
behavior is common because the final move command is an atomic operations
which ensures that only completely transmitted files are available within
the data source. In this use case lsyncd will trigger 4 rsync operations
and the data file will be transmitted twice.

The attached patch introduces the new configuration node which
may be configured in the global section or on a
basis. If no node is configured then the previously described
default event list is used.

Sample configuration: