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 Lsyncd21Manual
License: GPLv2 or any later GPL version.
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.
(root) # apt-get install lsyncd
#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 Lsyncd21Manual.
root@ubuntu:~# lsyncd -nodaemon -rsync ~/tmp 22.214.171.124:tmp 03:49:50 Normal: recursive startup rsync: /root/tmp/ -> 126.96.36.199:tmp/ firstname.lastname@example.org's password: 03:49:56 Normal: Startup of '/root/tmp/' finished.