Skip to content

Allow databases to be excluded#18

Open
aweakley wants to merge 1 commit into
masterfrom
allow_excluded_databases
Open

Allow databases to be excluded#18
aweakley wants to merge 1 commit into
masterfrom
allow_excluded_databases

Conversation

@aweakley

@aweakley aweakley commented Jul 9, 2026

Copy link
Copy Markdown
Member

Adds two optional settings EXCLUDED_DATABASES (global, extends existing built-in list postgres, rdsadmin, template0) and EXCLUDED_DATABASES_N (host-specific, overrides the global setting) so that not every database has to be backed up.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 9, 2026 02:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) and EXCLUDED_DATABASES_N (cluster-specific override) configuration.
  • Update bin/backup.sh to build an exclusion list and generate a pg_database query 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.

Comment thread README.md
-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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants