Bug 14262 - add continuous sync mode using inotify/fanotify/etc
Summary: add continuous sync mode using inotify/fanotify/etc
Status: NEW
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.1.3
Hardware: All All
: P5 enhancement (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
Depends on:
Reported: 2020-02-04 05:41 UTC by Paul Wise
Modified: 2020-02-04 05:45 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Paul Wise 2020-02-04 05:41:17 UTC
rsync is often run from cron, which means it has to walk entire directory trees every time it is run, which is inefficient when it is run often.

Most operating systems offer APIs (such as inotify/fanotify on Linux) that allow programs to be notified of filesystem changes.

To replace rsync in cron jobs, rsync could offer a mode that would register for filesystem change notifications, do a regular sync and then for each filesystem change notification, transfer the changes to the remote end (or local end for a reverse transfer). SIGINT/Ctrl+C or other termination signals could be used to end the continuous sync.
Comment 1 Paul Wise 2020-02-04 05:45:40 UTC
I note that the lsyncd tool can be used to work around this feature being missing from rsync. By default it collates filesystem events over several seconds and then runs rsync to transfer the changes. Giving rsync the ability to do this itself would be more efficient and reduce the sync delay.