Stop watching tar archives fail silently mid-stream

Backup & Recovery (Rsync/Tar/Dd)

Stop watching tar archives fail silently mid-stream

🧩 The Challenge

Everyone has had that moment where you extract a massive backup only to find out halfway through that the archive was corrupted or truncated. Finding out after twenty minutes of waiting is the worst kind of surprise.

💡 The Fix

Throw the verify flag into your tar command to make sure the archive contents actually match the filesystem before you assume you’re safe. It adds a bit of time but saves your skin during a restore.

tar -cvf backup.tar /data && tar -dvf backup.tar -C /

⚙️ Why It Works

Adding the -d flag tells tar to compare the archive against the source files, basically acting like a checksum validation in real-time. If it catches a discrepancy, it’ll bark at you right there instead of waiting for a disaster.

🚀 Pro-Tip: Pipe your archive through gpg if you need to encrypt it, but always verify the checksums separately if you can.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted