Stop stressing about rsync permissions during restores

Backup & Recovery (Rsync/Tar/Dd)

Stop stressing about rsync permissions during restores

🧩 The Challenge

You finally reach the day you need to pull data back from your off-site rsync backup, only to find all the ownership metadata is messed up because you didn’t run as root. Now you have a pile of files owned by your local user and nothing will boot or serve traffic correctly.

💡 The Fix

Always keep the archive flag active to preserve everything, and throw in the numeric ids flag so you aren’t relying on the UID-to-username mapping being identical on both machines. It saves you from a total permission nightmare.

rsync -aHAXv --numeric-ids /source/path/ /destination/path/

⚙️ Why It Works

Using –numeric-ids keeps the user and group IDs as raw integers, meaning the system won’t try to resolve them against a user database that might be completely different on the target box. The -aHAX trio handles the recursive copy while keeping hard links and extended attributes exactly where they belong.

🚀 Pro-Tip: Always pipe that into a dry run first unless you like sweating over accidental overwrites.

Linux Tips & Tricks | © ngelinux.com | 10/22/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted