Stop your tar archives from being silently corrupted by file changes

Backup & Recovery (Rsync/Tar/Dd)

Stop your tar archives from being silently corrupted by file changes

🧩 The Challenge

Backing up live database directories or active logs with tar feels safe until you try to restore and find out the files changed mid-stream. I’ve wasted hours chasing data integrity errors because the archive grabbed a half-written file.

💡 The Fix

Use the checkpointing features in tar to verify integrity and, more importantly, let tar handle the exit codes properly when a file disappears during the read. It keeps you from blindly trusting a corrupt tarball.

tar --create --file=backup.tar --checkpoint=1000 --totals --ignore-failed-read /var/log/active-app

⚙️ Why It Works

Setting a checkpoint forces tar to print progress signals, and ignoring failed reads prevents the whole backup job from nuking itself if a temporary file gets deleted while you are mid-archive. It transforms a fragile process into something that actually finishes.

🚀 Pro-Tip: Pipe your tar output through pigz instead of using the built-in z compression to cut your wait times in half.

Linux Tips & Tricks | © ngelinux.com | 9/3/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted