Stop your backups from silently corrupting due to mid-stream file writes
Backup & Recovery (Rsync/Tar/Dd)
Stop your backups from silently corrupting due to mid-stream file writes
🧩 The Challenge
Backing up an active database or a directory full of log files with standard tar is a recipe for heartbreak. You end up with an archive that contains half-written files, which means you’ve effectively got zero working backups when the inevitable disaster strikes.
💡 The Fix
Use the rsync –inplace flag to update files without creating temp copies, or better yet, force a consistent snapshot by piping through a tool that handles file locking. If you’re doing a quick stream, just make sure you aren’t grabbing files that are being actively nuked by a logrotate job.
rsync -av --inplace --partial --no-compress /source/data/ /backup/destination/
⚙️ Why It Works
By telling rsync to operate –inplace, you stop the tool from creating those temporary hidden files that trigger a massive amount of unnecessary disk I/O and potential collisions during large sync jobs. It saves your sanity and keeps the backup consistent with the live state.
🚀 Pro-Tip: Pipe your rsync output to a log file if you’re running it in a cron job, otherwise you’ll be debugging phantom missing files for weeks.
Linux Tips & Tricks | © ngelinux.com | 7/18/2026
