Stop assuming rsync preserves your extended attributes
Backup & Recovery (Rsync/Tar/Dd)
Stop assuming rsync preserves your extended attributes
🧩 The Challenge
You finally moved your critical web assets to a new server, but suddenly the permissions and SELinux contexts are a total disaster. It’s infuriating when files land on the new drive but the metadata that actually makes them work is left behind.
💡 The Fix
You need to explicitly tell rsync to reach into the extended attributes and ACLs, because it ignores them by default. It’s the only way to make a remote move feel like a local clone.
rsync -avHAX --numeric-ids /source/path/ user@remote:/destination/path/
⚙️ Why It Works
Adding the X flag forces rsync to handle extended attributes, while A ensures all your ACLs carry over instead of getting stripped out during the transfer.
🚀 Pro-Tip: Use –numeric-ids so you don’t end up with broken file ownership if your UIDs don’t match exactly on the destination box.
Linux Tips & Tricks | © ngelinux.com | 8/27/2026
