lsyncd
watches directories for changes and synchronizes them in real-time
TLDR
Sync directories locally
SYNOPSIS
lsyncd [-rsync source dest] [-rsyncssh source host dest] [-log level] [options] [config.lua]
DESCRIPTION
lsyncd (Live Syncing Daemon) watches directories for changes and synchronizes them in real-time. It uses inotify on Linux to detect file changes efficiently.
When changes occur, lsyncd waits briefly (delay) to aggregate multiple changes, then triggers rsync to synchronize. This approach handles burst writes efficiently while maintaining near-real-time sync.
Configuration files use Lua scripting for flexibility. They define sync pairs, exclude patterns, rsync options, and can implement custom sync logic.
The tool works with both local directories and remote servers via SSH. Multiple sync pairs can run simultaneously from a single configuration.
Common uses include backup systems, cluster file synchronization, and development environments where files need to stay synchronized across machines.
PARAMETERS
-rsync SOURCE DEST
Simple rsync sync mode.-rsyncssh SOURCE HOST DEST
Rsync over SSH to remote host.-nodaemon
Run in foreground, don't daemonize.-log LEVEL
Set log level (all, scarce, normal, error).-logfile FILE
Write logs to file.-pidfile FILE
Write PID file.-delay SECONDS
Delay before syncing (aggregation window).-insist
Keep trying on startup errors.-version
Show version.-help
Show help.
CAVEATS
Initial sync can take time for large directories. Inotify watch limits may need increasing for large trees. High-frequency changes can cause delays. Symlinks and special files need careful handling.
HISTORY
lsyncd was created by Axel Kittenberger around 2008. It combined inotify's efficient change notification with rsync's reliable file synchronization. The project introduced Lua configuration in version 2, enabling sophisticated sync scenarios.
SEE ALSO
rsync(1), inotifywait(1), unison(1), syncthing(1)
