Stop your rsync backups from choking on file metadata
Backup & Recovery (Rsync/Tar/Dd)
Stop your rsync backups from choking on file metadata
🧩 The Challenge
You are moving a massive directory tree between filesystems and suddenly all your file permissions and ownership data go up in smoke. It drives me crazy when a simple backup turns into a permission hellscape because the archive bits didn’t travel with the files.
💡 The Fix
You need to tell rsync to preserve the metadata explicitly, otherwise it defaults to the permissions of the user running the command. It’s the only way to make sure the target looks exactly like the source.
rsync -aHAXv /source/ /destination/
⚙️ Why It Works
Adding these flags preserves recursive structures, hard links, access control lists, and extended attributes. Skipping them is usually why your restored backups end up with every file owned by root.
🚀 Pro-Tip: Always include a trailing slash on the source directory if you want the contents, not the directory itself.
Linux Tips & Tricks | © ngelinux.com | 10/15/2026
