We ❤️ Open Source
A community education resource
The one rsync mistake that could destroy your backups
Learn Linux TV shows you how to safely transfer files between servers without losing data or metadata.
Want to master file transfers between Linux servers? Your answer is rsync, offering far more control than basic tools like SCP. In his video from Learn Linux TV, Jay shares how to safely sync files across systems while preserving metadata, avoiding common pitfalls, and using powerful options that give you complete control over your transfers.
The tutorial walks through rsync fundamentals, starting with installation checks and basic syntax before moving into practical examples. Jay demonstrates the critical importance of testing commands with --dry-run before executing them, shows how trailing slashes change directory behavior, and explains why rsync isn’t quite a true sync by default.
This video covers essential options like verbose mode, recursive copying, and the --delete flag, then introduces archive mode as the go-to solution for preserving file metadata during transfers. Throughout the demonstration, Jay syncs a real notes directory between servers, showing both backup and restore operations while highlighting potential gotchas like file renaming issues.
Key takeaways
- Always test first with
--dry-run– This safety net shows exactly whatrsyncwill do before actually copying files, preventing costly mistakes. - Archive mode (
-a) is your best friend – It preserves modification times, permissions, ownership, and symbolic links, making it perfect for backups. - Trailing slashes change everything –
notes/copies the directory’s contents whilenotescopies the directory itself, a crucial distinction for getting the structure you want.
For Linux administrators who need reliable, flexible file transfers, rsync stands out as an essential tool. The combination of -av --delete handles most backup scenarios, and understanding that rsync is fundamentally a one-way transfer tool helps you use it effectively. Whether you’re setting up automated backups or syncing development environments, this utility delivers the control and reliability you need.
More from Learn Linux TV
- youtube.com/learnlinuxtv
- Linux tips | Linux how-to’s | Linux installation guides
- What powers 400 Million terabytes of data every single day?
- Why Linux experts are ditching Man pages for this simple tool
- 10 tips to learn Linux easier and faster
The opinions expressed on this website are those of each author, not of the author's employer or All Things Open/We Love Open Source.