Repository navigation
dev2-pg-backup: make room before each full dump, fix retention off-by-one - #266
Merged
Merged
Conversation
…-one The daily full writes a new ~58 GB nichedb dump before the old ones age out. On 2026-11-11 and 11-12 the 05:20 run took dev2's / from ~38 GB free to 0, failing the rssamplifier and bittorrented fulls and every write on the box. - make_room_for_full: before each full, require the last full's size plus FULL_MIN_FREE_GB (default 40). Drop that database's older fulls (never the newest) to get there, else skip the dump with an alert. - Retention uses -mmin: `-mtime +2` only matches files 3+ whole days old, so "keep 2 days" kept three nichedb fulls (172 GB). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ThreatCrush Security Scan41 finding(s) HIGH/CRITICAL: 15 | MEDIUM: 12 | LOW: 14
Snippets are redacted; ThreatCrush never prints matched credential material. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dev2's
/hit 0 bytes on 2026-11-12 08:40 UTC (it got to 6 GB the day before). The cause was the dailydev2-pg-backup.sh fullrun./var/backups/postgresheld 409 GB: three 57.6 GB nichedb fulls, two 19.8 GB rssamplifier fulls, and 193 GB of 4-hourly dumps.KEEP_FULL_DAYS=2used-mtime +2, which only matches files 3 or more whole days old, so three fulls were kept.Changes
make_room_for_full: before each full (shared cluster and per-site stacks), require last full size +FULL_MIN_FREE_GB(default 40). Delete that database's older fulls, never the newest. If there's still no room, skip with an alert instead of filling the disk.-mmin +N*1440.Tested by running
make_room_for_fullagainst a scratch dir with fake fulls. With room it touches nothing. With a huge floor it deletes the older nichedb fulls, keeps the newest, leavesnichedbdev-full-*alone, returns 1, and alerts.bash -npasses.The off-box copy is still missing: the log says "same-box only". seed1, which pulled these, is gone.
🤖 Generated with Claude Code