This checklist is the manual version of what a backup assurance job should do every day. It takes about five minutes on a folder you already have. Run each step against a copy or read-only mount, never against the live job's output directory.
Throughout, assume the folder is named BACKUP_DIR and the job writes one file per day.
export BACKUP_DIR=/srv/backups
1. Freshness: is the newest file actually new?
Do not trust the exit code of the job. Check the modification time of what it produced.
find "$BACKUP_DIR" -type f -printf '%TY-%Tm-%Td %TH:%TM %10s %p\n' \
| sort | tail -5
If the newest file is older than one schedule period plus a margin, the job is late or has stopped. Two traps:
- Preserved timestamps.
rsync -a,cp -pand many database dump wrappers keep the original mtime, so a freshly copied archive can look days old. If you use them, base freshness on the filename's date or on a marker file the job touches on completion. - A hanging job. The newest file is today's, but it is still being written. Compare size between two samples a minute apart before declaring it complete.
2. Size floor: compare against the file's own history, not a fixed number
A minimum of "1 byte" only catches empty files. A realistic floor is a fraction of the median size of the last successful runs for that path.
find "$BACKUP_DIR" -type f -name '*.zip' -printf '%s %p\n' | sort -n | head -3
A single outlier at the bottom of that list is the classic silent failure: the dump was truncated, the database connection dropped mid-export, or the job wrote an error page where a stream should be. Flag anything below roughly 25–50% of the trailing median. Do not compare a full backup to an incremental one; they are different populations.
3. Content drift: keep a baseline of size plus a content hash
Existence and freshness both pass for a file that has changed when it should not have. Schema migrations, a wrong table list, a misconfigured --exclude, or a partial restore into the source directory all produce a valid, fresh, wrong archive.
Store, per relative path: size and one content hash. Compare on every run.
# any content hash you have; b3sum and md5sum are as valid as anything else here
b3sum "$BACKUP_DIR/db-2026-12-03.sql.gz" > /var/lib/backup-baseline/db-2026-12-03.sql.gz.hash
What to expect:
- Rotating filenames (
daily-2026-12-04.zip) legitimately change every day. Your baseline has to be tied to retention (the last 7 daily files exist and are non-trivial) rather than to one name. - Re-compressed archives change every byte without the data changing. If your job recompresses nightly, hash the decompressed payload or the database dump inside it, not the container.
- Any unplanned change is a finding, even if the file is bigger. Treat "it grew 40% overnight" the same way you treat "it shrank 40%": ask what changed.
4. Archive structure: the file is not the data
A file can exist, be the right size, have the right hash, and still be unopenable. Test the structure, cheaply and read-only:
unzip -t "$BACKUP_DIR/daily-2026-12-04.zip" # CRC over every member
gzip -t "$BACKUP_DIR/db-2026-12-04.sql.gz" # one full decompress pass
tar -tzf "$BACKUP_DIR/files-2026-12-04.tar.gz" >/dev/null
For a SQLite database, the header and page arithmetic are worth checking before you open it:
sqlite3 "$BACKUP_DIR/app-2026-12-04.db" 'PRAGMA quick_check;'
quick_check is cheaper than integrity_check and still catches page corruption, truncated files and a missing header. Skip .sqlite files that are still being written — a header test on a database mid-transaction tells you nothing useful.
Set a cap on how much you decompress in one pass. A 900 GB tarball or a decompression bomb will otherwise turn your daily check into an outage of its own. A few hundred megabytes, or a member count limit, is usually enough to know whether the stream is sound.
5. Missing files: a deletion is a drift, not a cleanup
"The file is gone" is the most alarming result and the easiest to miss, because most scripts only iterate over files that exist. Maintain the list of paths you expect and diff against it:
comm -23 <(sort /var/lib/backup-baseline/expected.txt) \
<(cd "$BACKUP_DIR" && find . -type f | sed 's|^\./||' | sort)
Anything in the left column is a file that used to exist and no longer does. Two legitimate explanations: retention deleted it on purpose, or the job was moved to another volume. Both should be a deliberate change to the expected list, made by a human, not an accident discovered weeks later.
6. A restore test, on a schedule, not on principle
Structure tests prove the container is readable. They do not prove that the data inside is complete or that the restore procedure works. Once a quarter, restore the newest archive into a scratch environment, start the application against it, and count rows in three tables you care about. Record the date and the result. If nobody has done this in the last 90 days, your real recovery time objective is unknown.
7. Alert on changes, not on every run
A daily job that emails "all good" trains people to ignore it. The useful signal is a transition: ok → late, ok → missing, ok → changed, ok → corrupt. Send those to the channel the on-call person actually reads, include the relative path and the short reason, and stay silent otherwise. Keep the history so you can answer "when did this start?" — a single snapshot cannot.
Failure modes this catches
| What you see | Likely cause | First move |
|---|---|---|
| Newest file is 3 days old, job exit code 0 | Cron entry lost, or the job is silently skipped | Check the scheduler and the job log |
| File is 2 KB where 400 MB is normal | Truncated dump, dropped connection, error text written to the archive | Re-run the export, check the source database |
Fresh file, small size, passes unzip -t | Empty or partial export | Compare table counts against the source |
Correct size, unzip -t fails | Disk error or a copy interrupted mid-write | Re-run and check the destination disk |
| One file vanished | Retention change, or a deleted volume | Decide whether it is expected; update the expected list |
| Changes every night, nobody knows why | Wrong table list, exclude pattern, or recompression | Diff the archive contents, not just the bytes |
Where the manual version breaks down
Every step above is a script. The problem is not writing the first one — it is owning it forever: state that survives the shell session, a schedule that runs whether or not anyone is logged in, thresholds per folder, a history table, change-only alerting, and an API for the rest of your tooling. That is a small service, and most teams end up maintaining a fragile one they never wanted.
Backup Integrity Drift Watch is that service, packaged as one Docker container you host yourself: it mounts the backup folder read-only, runs the freshness, size, baseline, archive and missing-file checks on a schedule, keeps 90 days of history in SQLite, posts to your webhook only when a status changes, and exposes /api/backups for polling. Backup contents never leave your server; only metadata is stored. The full package includes the complete source, a setup.sh that configures it in one command, and a doctor command that prints what is wrong and how to fix it.