Stop rsync from failing when file names have weird encoding
Backup & Recovery (Rsync/Tar/Dd)
Stop rsync from failing when file names have weird encoding
🧩 The Challenge
You finally get your massive multi-terabyte backup job running overnight, only to wake up and see rsync choked on a single file with a mangled character encoding. It’s infuriating to lose eight hours of progress just because some developer uploaded a file with a non-UTF8 filename.
💡 The Fix
Use the –iconv flag to force conversion of file names between systems. It saves you from having to hunt down those invisible characters manually.
rsync -av --iconv=UTF-8,UTF-8 --delete /source/ /destination/
⚙️ Why It Works
Passing the same charset on both sides forces rsync to skip its default validation logic that often gets tripped up by legacy filenames. This trick essentially ignores the invalid bytes that usually cause the sync to abort prematurely.
🚀 Pro-Tip: Always add –partial when moving huge data so you can resume where you left off instead of starting from zero.
Linux Tips & Tricks | © ngelinux.com | 12/4/2026
