Lsyncd (Live Syncing Daemon) synchronizes local directories with remote targets
Lua C CMake Other
Permalink
Failed to load latest commit information.
cmake made compatible with lua5.3 Nov 24, 2016
doc/manpage preparing 2.2.1 Jan 5, 2017
examples Updated lbash.lua and lrsync.lau to remove the equals (=) from the se… Aug 31, 2016
m4 Try harder to find matching Lua program/library pairs Oct 2, 2012
tests reverting to rsync filter useage, until rysnc bug is fixed Feb 16, 2017
.gitignore adding install targets and reenabling the manpage stuff Apr 29, 2014
CMakeLists.txt reverting to rsync filter useage, until rysnc bug is fixed Feb 16, 2017
COPYING Fix documentation spelling bits, and a few links May 4, 2013
ChangeLog reverting to rsync filter useage, until rysnc bug is fixed Feb 16, 2017
INSTALL Correct typo Nov 26, 2015
README.md readme Jan 5, 2017
bin2carray.lua fix script integration May 4, 2011
config.h.in Replacing autotools with CMake Apr 29, 2014
default-direct.lua adding -p to cp for default.direct. Put a log message before daemoniz… Dec 2, 2016
default-rsync.lua reverting to rsync filter useage, until rysnc bug is fixed Feb 16, 2017
default-rsyncssh.lua reverting to rsync filter useage, until rysnc bug is fixed Feb 16, 2017
default.lua cleanups Dec 13, 2016
distclean.sh adding a distclean script Dec 13, 2016
fsevents.c lock pidfile, remove pidfile on INT or TERM Jul 30, 2013
inotify.c fixing again setting with new delay objects, cleanups Feb 6, 2017
lsyncd.c fixing again setting with new delay objects, cleanups Feb 6, 2017
lsyncd.h made compatible with lua5.3 Nov 24, 2016
lsyncd.lua reverting to rsync filter useage, until rysnc bug is fixed Feb 16, 2017

README.md

Lsyncd -- Live Syncing (Mirror) Daemon

Description

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 acheived. 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 remotehost.org::share/

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 remotehost.org 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.

Disclaimer

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.