Stop letting massive tar archives fail halfway through without knowing why
Backup & Recovery (Rsync/Tar/Dd)
Stop letting massive tar archives fail halfway through without knowing why
🧩 The Challenge
Nothing ruins a Monday like pulling a 400GB backup off a server only to realize the archive is corrupted because the network hiccuped halfway through. I’ve spent way too many nights re-running massive dumps because I didn’t verify the stream until it was already too late.
💡 The Fix
Start using the verbose mode along with a verification pass so you catch silent bit rot or truncated pipes before you delete the original data. It adds a little time, but it saves your bacon when you actually need to restore.
tar -cvzf - /data/project/ | tee >(sha256sum > backup.sha256) | cat > backup.tar.gz
⚙️ Why It Works
By piping the output through tee, you calculate the hash of the stream in real-time as it writes to disk. Since you aren’t storing the whole thing in memory, it doesn’t matter how large the directory is.
🚀 Pro-Tip: Always keep the checksum file in a different directory than the archive itself.
Linux Tips & Tricks | © ngelinux.com | 12/3/2026
