Be the first to know and get exclusive access to offers by signing up for our mailing list(s).

Subscribe

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 what rsync will 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 while notes copies 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

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.

Working on something worth sharing? Write for us.

Contribute to We ❤️ Open Source

Help educate our community by contributing a blog post, tutorial, or how-to.

Two World-class Events

If you didn't make it to All Things AI, check out the event summary, and make plans to join us October 19-20 for All Things Open.

Open Source Meetups

We host some of the most active open source meetups in the U.S. Get more info and RSVP to an upcoming event.