Stop backing up the junk your logs leave behind
Backup & Recovery (Rsync/Tar/Dd)
Stop backing up the junk your logs leave behind
🧩 The Challenge
Everyone has that one backup script that bloats to terabytes because it blindly hits /var/log or your application’s massive cache directories. I once watched a three-hour rsync job crawl to a halt because it was busy reading a 50GB rotated log file that nobody was ever going to look at again.
💡 The Fix
Use an exclude file to prune the trash before you start the transfer. It keeps your backups lean and prevents your disks from choking on transient garbage.
rsync -av --exclude-from='/home/admin/backup_excludes.txt' /source/ /backup/
⚙️ Why It Works
Passing that list to the exclude flag tells rsync to ignore path patterns during the initial scan phase. You save massive amounts of time by not even bothering to touch files that don’t belong in your archive.
🚀 Pro-Tip: Stick the exclude file in your backup script’s repo so you don’t lose your blacklist when the hardware dies.
Linux Tips & Tricks | © ngelinux.com | 9/22/2026
