Verify your tars before you assume the tape drive worked

Backup & Recovery (Rsync/Tar/Dd)

Verify your tars before you assume the tape drive worked

🧩 The Challenge

Everyone thinks their backup script is solid until they try to pull data back and realize the archive is just a bunch of empty headers. I’ve spent an entire night rebuilding a database because I trusted a tar command that failed silently midway through.

💡 The Fix

Use the diff flag to compare your archive against the source files before you wipe the production disk. It’s the only way to sleep through the night without wondering if you actually saved your bacon.

tar --diff -f backup.tar.gz -C /path/to/source/data .

⚙️ Why It Works

Adding that flag tells tar to compare the file metadata and contents against the disk state rather than just reading the header and assuming success. You’ll get a nice list of what doesn’t match, which usually highlights permissions issues or files that were modified while you were reading them.

🚀 Pro-Tip: Pipe the output to a log file if you’re checking a directory with millions of tiny files, otherwise your terminal buffer will explode.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted