Allow databases to be excluded#18
Open
aweakley wants to merge 1 commit into
Open
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds support for excluding specific PostgreSQL databases from backups via environment variables, allowing per-cluster overrides so not every database in a cluster must be dumped.
Changes:
- Add
EXCLUDED_DATABASES(global) andEXCLUDED_DATABASES_N(cluster-specific override) configuration. - Update
bin/backup.shto build an exclusion list and generate apg_databasequery accordingly, plus cleanup behavior for dump files. - Add a bash test script to verify global exclusions and per-cluster override precedence.
Reviewed changes
Copilot reviewed 1 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| README.md | Documents the new exclusion environment variables and override precedence. |
| bin/tests/backup-excluded-databases.sh | Adds a regression test validating exclusions and cleanup behavior. |
| bin/backup.sh | Implements exclusion handling, dump dir configurability, SQL quoting, and cleanup changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| -e RESTIC_KEEP_WEEKLY='4' | ||
| -e RESTIC_KEEP_MONTHLY='12' | ||
| -e RESTIC_KEEP_YEARLY='7' | ||
| -e EXCLUDED_DATABASES='db_to_skip,another_db' # Global exclusions for all clusters |
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.
Adds two optional settings
EXCLUDED_DATABASES(global, extends existing built-in listpostgres,rdsadmin,template0) andEXCLUDED_DATABASES_N(host-specific, overrides the global setting) so that not every database has to be backed up.