Rsync Documentation
A structured guide to mastering rsync for server administration, backups, migrations, and deployments. From first-time setup to production-grade automated backup systems.
Learning Path
1. Introduction
Start here to understand what rsync does, how to install it, and the fundamentals.
- What is Rsync? — How rsync works and why it's the standard
- History and Popularity — The origins and evolution of rsync
- Installation and Setup — Get rsync running on any system
- Strengths and Limitations — Analysis of core capabilities
- Rsync vs SCP — When to use each tool
- Alternatives — Other tools for sync and transfer
- Incremental Sync — Transfer only what changed
- Professional Strategy — Think like a sysadmin
2. Core Rsync
Master the building blocks: paths, flags, and command structure.
- Source and Destination — Path syntax and trailing slash behavior
- Options and Flags — Complete flag reference
- Operators and Keywords — Command composition
3. Real-World Sync Patterns
Practical patterns for syncing application code, plugins, and media.
- Application Core and Binaries — Syncing immutable code
- Extensions and Modules — Manage dependencies and modular files
- User Media and Uploads — Handle large media libraries
4. Database Export + Rsync
Combine file sync with database backups for complete server recovery.
- Database Export and Rsync — Export, compress, and sync
- Live Replication Edge Cases — Why you can't rsync live databases
5. Security and Permissions
Protect your data in transit and manage file ownership correctly.
- Secure Transfer — SSH keys, encryption, and access control
- Ownership and Permissions — Preserve or set permissions
6. Compression and Bandwidth
Optimize transfer speed and network usage.
- Compression and Bandwidth — When to compress, bandwidth limits
- Parallel and Incremental Sync — Scale with
--link-destand parallelism
7. Advanced Filters and Edge Cases
Fine-tune exactly what gets synced and how to verify it.
- Exclude and Include Patterns — Filter rules and pattern matching
- Handling Deleted Files — Safe use of
--delete - Logging and Monitoring — Track and audit transfers
- Dry Run and Testing — Preview before executing
8. Automation and Scheduling
Run rsync on autopilot with proper error handling.
- Cron Automation — Scheduled backups with cron and systemd
- CI/CD Automation — Deploy with GitHub Actions and GitLab CI
9. Backup Strategies
Design and implement production-grade backup systems.
- Backup Strategies — Full, incremental, differential, and retention
- Disaster Recovery — Restore from backups after incidents
- Cloud Storage Integration — Offsite backups with rclone
- Database Sync — Coordinated file + database backups
- Security Hardening — Protect backup operations
- Performance Tuning — Optimize for speed and efficiency
10. Troubleshooting
Diagnose and fix problems when things go wrong.
- Troubleshooting and Debugging — Systematic error diagnosis
- Exit Codes and Error Handling — Build reliable scripts
- Compatibility Issues — Cross-platform and version problems
11. Cheat Sheets
Concise, mobile-friendly reference cards for every rsync feature.
- Basic Commands — Core syntax and essential commands
- Archive & Transfer — What
-adoes, transfer mode flags - Remote & SSH — SSH options, keys, config
- Filter Patterns — Exclude, include, and filter rules
- Delete Options — Safe deletion workflows
- Permissions & Ownership — chmod, chown, ACLs
- Compression & Bandwidth — When to compress, bandwidth limits
- Incremental Backups — link-dest, compare-dest, snapshots
- Logging & Output — Progress, stats, itemize-changes
- Performance Tuning — Speed optimization by scenario
- Dry Run & Testing — Preview before executing
- Error Handling — Exit codes and retry patterns
- Daemon Mode — rsyncd.conf setup
- Cross-Platform — macOS, Windows, filesystem quirks
Quick Start
# Basic sync (archive mode, verbose)
rsync -av /source/ /destination/
# Remote sync over SSH
rsync -avz /local/path/ user@remote:/remote/path/
# Preview before executing
rsync -avn /source/ /destination/
# Incremental backup with snapshots
rsync -av --link-dest=/backup/latest /source/ /backup/$(date +%F)/
New to rsync? Start with What is Rsync? and work through the learning path in order.