Lsyncd (Live Syncing Daemon) synchronizes local directories with remote targets
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Daniel Poelzleithner dd48284cd0
fix changelog dates
3 months ago
.github/workflows disable lua 5.4.4 due segfault on luac invocation 3 months ago
cmake change header discription 11 months ago
docs Document crontab support 8 months ago
examples Fix more warnings from static code analysis 3 months ago
m4 Try harder to find matching Lua program/library pairs 10 years ago
tests Allow lsyncd to be build in the source folder without breaking. Not recommended 3 months ago
.editorconfig add .editorconfig 11 months ago
.gitignore fix cron test 3 months ago
CMakeLists.txt Allow lsyncd to be build in the source folder without breaking. Not recommended 3 months ago
COPYING Fix documentation spelling bits, and a few links 10 years ago
ChangeLog fix changelog dates 3 months ago
INSTALL preparing 2.2.3 5 years ago fix manual link 10 months ago
bin2carray.lua fix script integration 12 years ago Remove /System/Volumes/Data from fsevent paths on macOS 2 years ago
default-direct.lua Finish full sync cron trigger 8 months ago
default-rsync.lua Fix more warnings from static code analysis 3 months ago
default-rsyncssh.lua Merge remote-tracking branch 'origin/pr/583' 1 year ago
default.lua Fix more warnings from static code analysis 3 months ago adding a distclean script 6 years ago
flake.lock update nix locks 3 months ago
flake.nix nix: extract version from lsyncd.lua 3 months ago
fsevents.c Remove /System/Volumes/Data from fsevent paths on macOS 2 years ago
inotify.c cleanups 5 years ago
lsyncd.c lua 5.4 fixes 8 months ago
lsyncd.h add onepass option to exit after initial sync 4 years ago
lsyncd.lua check alarm for type first. fixes #679 3 months ago

Lsyncd -- Live Syncing (Mirror) Daemon


Lsyncd watches a local directory trees event monitor interface (inotify or fsevents). It aggregates and combines events for a few seconds and then spawns one (or more) process(es) to synchronize the changes. By default this is rsync. Lsyncd is thus a light-weight live mirror solution that is comparatively easy to install not requiring new filesystems or block devices and does not hamper local filesystem performance.

Rsync+ssh is an advanced action configuration that uses a SSH to act file and directory moves directly on the target instead of re-transmitting the move destination over the wire.

Fine-grained customization can be achieved through the config file. Custom action configs can even be written from scratch in cascading layers ranging from shell scripts to code written in the Lua language. This way simple, powerful and flexible configurations can be achieved. See the manual for details.

Lsyncd 2.2.1 requires rsync >= 3.1 on all source and target machines.

License: GPLv2 or any later GPL version.

When to use

Lsyncd is designed to synchronize a local directory tree with low profile of expected changes to a remote mirror. Lsyncd is especially useful to sync data from a secure area to a not-so-secure area.

Other synchronization tools

DRBD operates on block device level. This makes it useful for synchronizing systems that are under heavy load. Lsyncd on the other hand does not require you to change block devices and/or mount points, allows you to change uid/gid of the transferred files, separates the receiver through the one-way nature of rsync. DRBD is likely the better option if you are syncing databases.

GlusterFS and BindFS use a FUSE-Filesystem to interject kernel/userspace filesystem events.

Mirror is an asynchronous synchronisation tool that takes use of the inotify notifications much like Lsyncd. The main differences are: it is developed specifically for master-master use, thus running on a daemon on both systems, uses its own transportation layer instead of rsync and is Java instead of Lsyncd's C core with Lua scripting.

Lsyncd usage examples

lsyncd -rsync /home

This watches and rsyncs the local directory /home with all sub-directories and transfers them to 'remotehost' using the rsync-share 'share'.

lsyncd -rsyncssh /home backup-home/

This will also rsync/watch '/home', but it uses a ssh connection to make moves local on the remotehost instead of re-transmitting the moved file over the wire.

Some more complicated examples, tips and tricks you can find in the manual.


Besides the usual disclaimer in the license, we want to specifically emphasize that the authors, and any organizations the authors are associated with, can not be held responsible for data-loss caused by possible malfunctions of Lsyncd.