Stop rsync from leaving you with broken file permissions on network shares

Backup & Recovery (Rsync/Tar/Dd)

Stop rsync from leaving you with broken file permissions on network shares

🧩 The Challenge

You’ve finally got your offsite backups running, but you realize every single file ended up owned by the user who ran the script instead of the original owner. I’ve wasted hours manually chowning entire directory trees because rsync defaulted to assuming it couldn’t touch those UID/GID values.

💡 The Fix

Throw the archive and numeric-ids flags into your sync command to force rsync to keep the raw ID numbers intact regardless of the local user database. It saves you from a massive headache when you eventually have to restore that data.

rsync -av --numeric-ids --delete /source/ /destination/

⚙️ Why It Works

Setting the numeric-ids flag tells rsync to ignore the local /etc/passwd and /etc/group files and just shove the raw integers over to the destination. Otherwise, rsync tries to map the source IDs to local names, which almost always fails or defaults to the wrong user when you are backing up between different servers.

🚀 Pro-Tip: Always double check your destination partition supports extended attributes or you’ll lose your metadata anyway.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted