When you run a self-hosted infrastructure, keeping files in sync across servers, storage volumes, and cloud backups is a daily operational requirement. Whether you’re replicating data between data centers, syncing media libraries, or maintaining disaster recovery copies, the right tool makes the difference between automated reliability and manual chaos.
Three open-source tools dominate this space: rsync, the decades-old Unix standard for local and remote file synchronization; rclone, the cloud storage powerhouse supporting 70+ providers; and lsyncd, the live syncing daemon that automates rsync in real time.
This guide compares all three, explains when each tool is the right choice, and provides production-ready Docker Compose configurations you can deploy today.
| Tool | Stars | Last Updated | Language | Best For |
|---|---|---|---|---|
| rsync | N/A (core Unix utility) | N/A | C | Local/NFS sync, SSH transfers |
| rclone | 56,861 | Apr 24, 2026 | Go | Cloud storage sync, mounting |
| lsyncd | 6,034 | Nov 27, 2024 | Lua/C | Real-time directory mirroring |
Why Self-Hosted File Sync Matters
Cloud sync services like Dropbox, Google Drive, and OneDrive solve file synchronization for consumers, but they introduce several problems for infrastructure operators:
- Vendor lock-in: Migrating terabytes between cloud providers is expensive and slow
- Compliance: Many industries require data to remain on self-managed infrastructure
- Cost: Cloud egress fees and storage pricing scale poorly at large volumes
- Control: You can’t audit proprietary sync clients or customize their behavior
- Latency: Syncing through third-party servers adds unnecessary network hops
Self-hosted sync tools give you full control over data movement. They work over SSH, direct network mounts, or HTTP APIs — no intermediary required. And they compose well: you can use rsync for server-to-server replication, rclone for cloud backup tiers, and lsyncd for real-time mirroring, all within the same infrastructure.
For a broader view of self-hosted storage options, see our file sync and sharing comparison and backup tool guide. If you’re building a complete backup strategy, also check our backup verification and testing guide.
Understanding Each Tool
Rsync: The Unix Workhorse
Rsync has been part of the Unix ecosystem since 1996. Its core innovation is the delta-transfer algorithm, which sends only the differences between source and destination files rather than entire file contents. This makes rsync dramatically more efficient than naive copy tools, especially over slow or metered connections.
Key capabilities:
- Delta transfers: Only changed blocks are transmitted
- Compression:
-zflag compresses data during transfer - SSH transport: Built-in SSH support for encrypted transfers
- Partial transfers:
--partialresumes interrupted transfers - Exclude patterns:
--excludeand--includefor filtering - Hard link preservation:
--hard-linksmaintains link structure
Rsync ships with virtually every Linux and macOS distribution. It requires no additional dependencies and works out of the box.
Rclone: Cloud Storage Swiss Army Knife
Rclone describes itself as “rsync for cloud storage” — but it’s grown far beyond that tagline. It supports over 70 storage providers including S3-compatible services, Google Drive, Dropbox, Backblaze B2, Azure Blob, SFTP, WebDAV, and local filesystems.
Key capabilities:
- Multi-provider support: 70+ storage backends with consistent CLI
- Mount mode: FUSE-based mounting of cloud storage as a local filesystem
- Sync/copy/move: Full range of file operations with dry-run support
- Encryption: Client-side encryption with
cryptremote - Web GUI: Built-in web interface for monitoring and management
- REST API: JSON API for integration with other tools
- Bandwidth limiting:
--bwlimitfor throttling transfers - Checksums: Hash verification across providers
Rclone is written in Go and ships as a single static binary. It runs on Linux, macOS, Windows, and BSD systems.
Lsyncd: Real-Time Directory Mirroring
Lsyncd (Live Syncing Daemon) watches a local directory for filesystem changes using inotify or fswatch, then automatically triggers rsync or rsync-like commands to replicate those changes to a target. It fills the gap between manual rsync runs and complex distributed filesystems.
Key capabilities:
- Real-time sync: Sub-second detection and replication of changes
- Event coalescing: Groups rapid changes into single sync operations
- Multiple targets: Sync one directory to multiple destinations
- Custom actions: Lua scripting for pre/post-sync hooks
- Low overhead: Monitors only — no daemon on the target side
- SSH transport: Uses rsync over SSH by default
Lsyncd consists of a C inotify watcher and a Lua configuration engine. It runs on Linux and macOS.
Feature Comparison
| Feature | Rsync | Rclone | Lsyncd |
|---|---|---|---|
| Delta transfers | ✅ Yes | ✅ Yes (partial) | ✅ Via rsync |
| Real-time sync | ❌ Manual | ❌ Manual/scheduled | ✅ inotify-based |
| Cloud storage | ❌ No | ✅ 70+ providers | ❌ No (local only) |
| SSH transport | ✅ Native | ✅ SFTP backend | ✅ Via rsync |
| Encryption in transit | ✅ Via SSH | ✅ TLS/client-side | ✅ Via rsync/SSH |
| Bandwidth limiting | ✅ --bwlimit | ✅ --bwlimit | Via rsync config |
| Web GUI | ❌ No | ✅ Built-in | ❌ No |
| REST API | ❌ No | ✅ Available | ❌ No |
| Hard link support | ✅ --hard-links | ❌ No | ✅ Via rsync |
| Exclude patterns | ✅ Yes | ✅ Yes | ✅ Via rsync |
| Resume interrupted | ✅ --partial | ✅ Yes | Via rsync |
| Cross-platform | Unix, macOS, WSL | All platforms | Linux, macOS |
| FUSE mount | ❌ No | ✅ rclone mount | ❌ No |
| Configuration | CLI flags | Config file + flags | Lua config file |
When to Use Each Tool
Choose Rsync When:
- You need fast, efficient transfers between Linux/Unix servers
- You’re syncing over SSH to untrusted networks
- You want to preserve Unix file permissions, ownership, and hard links
- You need to sync NFS-mounted directories
- Bandwidth is limited and delta transfers matter
- You’re building backup scripts with
cron
Rsync excels at server-to-server replication. If both source and destination are Unix filesystems accessible via SSH or NFS, rsync is usually the best choice.
Choose Rclone When:
- You need to sync to or from cloud storage providers
- You want to mount cloud storage as a local filesystem
- You need client-side encryption for data at rest
- You’re managing data across multiple storage providers
- You want a web dashboard to monitor transfer progress
- You need to sync from systems where rsync isn’t available (Windows)
Rclone is the go-to tool for hybrid cloud architectures. It lets you treat every storage provider as a standardized remote, with consistent commands across all of them.
Choose Lsyncd When:
- You need real-time (sub-second) directory replication
- You want to automate rsync without cron scheduling
- You’re mirroring a web application’s upload directory to a CDN origin
- You need to sync configuration files across server clusters
- You want event-driven sync without polling overhead
Lsyncd is ideal when you need continuous synchronization but don’t want the complexity of a distributed filesystem like GlusterFS or Ceph.
Deployment Guides
Rsync: SSH-Based Sync Setup
Rsync requires no server installation — it only needs SSH access and rsync installed on both sides (which is the default on virtually all Linux systems).
Basic one-way sync:
| |
Bandwidth-limited sync with excludes:
| |
Automated sync via cron — add to /etc/crontab:
| |
Docker Compose for rsync daemon mode — when you need to accept incoming rsync connections without SSH:
| |
Create rsyncd.conf:
| |
Create rsyncd.secrets (chmod 600):
| |
Connect from a client:
| |
Rclone: Cloud Storage Sync
Install rclone:
| |
Configure a remote:
| |
This launches an interactive wizard. For Backblaze B2, you’d select:
| |
Sync local directory to cloud storage:
| |
Mount cloud storage as local filesystem:
| |
Docker Compose for rclone with web GUI:
| |
Generate the config file:
| |
Then mount it:
| |
Automated daily sync with cron inside Docker:
| |
Lsyncd: Real-Time Directory Mirroring
Install lsyncd (Debian/Ubuntu):
| |
Install lsyncd (RHEL/CentOS):
| |
Configuration file — edit /etc/lsyncd/lsyncd.conf.lua:
| |
This configuration watches /data/uploads and syncs changes to backup.example.com within 5 seconds of any modification. The delay = 5 setting coalesces rapid changes — if 100 files are modified within 5 seconds, they’re synced as a single rsync operation rather than 100 individual transfers.
Multiple targets from one source:
| |
Docker Compose for lsyncd:
| |
Verify lsyncd is running:
| |
Advanced Patterns
Combining All Three Tools
A production file sync architecture often uses all three tools together:
| |
- lsyncd handles real-time mirroring to the web server tier
- rsync runs hourly for incremental backups to a local backup server
- rclone runs daily to push an encrypted copy to cloud storage for disaster recovery
Encrypted Sync with Rclone Crypt
Rclone’s crypt remote provides transparent client-side encryption:
| |
| |
The data is encrypted before leaving your server. The cloud provider never sees your plaintext files or filenames.
Monitoring Rsync Transfers
For large rsync operations, use --info=progress2 for overall transfer progress:
| |
For detailed logging in scripts:
| |
Performance Tips
| Tool | Tip | Impact |
|---|---|---|
| Rsync | Use --checksum only when needed | Avoids full file reads on every run |
| Rsync | Use -W (whole-file) on fast LANs | Faster than delta algorithm locally |
| Rclone | Set --transfers to match your bandwidth | Prevents connection saturation |
| Rclone | Use --s3-upload-cutoff for large files | Reduces multipart upload overhead |
| Lsyncd | Set delay based on change frequency | Balances latency vs. batch efficiency |
| Lsyncd | Limit maxProcesses on busy servers | Prevents resource exhaustion |
FAQ
Can rclone replace rsync for local server-to-server sync?
Not entirely. While rclone supports SFTP and can sync between servers, rsync’s delta-transfer algorithm is significantly more efficient for Unix-to-Unix transfers. Rclone transfers entire changed files, whereas rsync only transfers the modified blocks. For large files with small changes over slow connections, rsync is always the better choice. Use rclone when cloud storage is involved.
Does lsyncd work with Windows file systems?
Lsyncd relies on inotify, which is Linux-specific. On macOS, it can use fswatch as an alternative backend. Windows is not supported. For Windows environments, consider using robocopy with Task Scheduler, or install WSL2 and use rsync within the Linux subsystem.
How do I handle SSH key authentication for automated rsync?
Generate an SSH key pair without a passphrase on the source server and add the public key to the destination server’s ~/.ssh/authorized_keys:
| |
Restrict the key’s capabilities in authorized_keys with command="rsync --server..." and from="source-ip" for security.
What happens if rclone sync is interrupted mid-transfer?
Rclone automatically resumes interrupted transfers. Files that were partially uploaded are detected and resumed from the point of interruption. Use the --progress flag to see transfer status, and check the log file with --log-file to confirm completion. The rclone check command can verify source and destination match after an interrupted sync.
Can lsyncd sync to multiple destinations simultaneously?
Yes. Define multiple sync{} blocks in the lsyncd configuration, each pointing to a different target. Lsyncd watches the source directory once and dispatches changes to all configured targets. Each target has its own process queue, so a slow destination won’t block faster ones. Set maxProcesses per sync block to control concurrency.
Is rsync secure enough for transfers over the public internet?
Rsync itself has no built-in encryption, but when used with SSH transport (rsync -e ssh or the default rsync:// over SSH), all data is encrypted in transit. Always use SSH for transfers over untrusted networks. For the rsync daemon mode (port 873), restrict access with hosts allow in rsyncd.conf and consider tunneling through SSH or a VPN.