Skip to content

[ADD] PostgreSQL backup from Docker containers#2

Open
antespi wants to merge 1 commit intomasterfrom
agent/sdd/7951d047
Open

[ADD] PostgreSQL backup from Docker containers#2
antespi wants to merge 1 commit intomasterfrom
agent/sdd/7951d047

Conversation

@antespi
Copy link
Copy Markdown
Owner

@antespi antespi commented Apr 26, 2026

Summary

Adds support for dumping PostgreSQL databases that run inside Docker containers, mirroring the existing host-level postgresql backup flow.

  • New BAK_POSTGRESQL_CONTAINERS_* block in config-dist/database.conf with default list/dump implementations (postgresql_container_databases, postgresql_container_dump) using docker exec + pg_dump / psql.
  • New postgresql_containers_backup() and postgresql_container_check() in lib/main.sh, plus directory creation and config-show reporting.
  • backup.sh wires the new step into the main backup flow after postgresql_databases_backup.

Closes SER-1.

Test plan

  • bash -n backup.sh lib/main.sh config-dist/database.conf (passes locally)
  • Run on a host with docker available and a running pg container; verify a ${date}-${container}-${db}.sql dump appears under data/postgresql-containers/
  • Run on a host without docker installed; verify the step auto-disables (status 2) without erroring
  • Verify backup.sh -c lists configured containers under "PostgreSQL Containers"

Adds support to dump PostgreSQL databases that run inside Docker
containers via `docker exec ... pg_dump`, mirroring the existing
host-level postgresql backup flow.

- New BAK_POSTGRESQL_CONTAINERS_* configuration block in
  config-dist/database.conf with default list/dump implementations
  (postgresql_container_databases, postgresql_container_dump).
- New postgresql_containers_backup() and postgresql_container_check()
  in lib/main.sh, plus directory creation and config-show reporting.
- backup.sh wires the new step into the main backup flow.
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.

1 participant