Dynamic multi-engine DB backups (fixes silent 11-month killbill gap) #1

Merged
mrouissi merged 1 commit from fix/dynamic-multi-engine-backups into master 2026-07-01 18:14:13 +02:00
Owner

The killbill DB was migrated Postgres->MariaDB and renamed (Aug 2025); the hardcoded container name + pg_dumpall meant killbill had NO backup for ~11 months while cron reported success. Also billing-postgres was never backed up.

Changes:

  • Dynamic discovery by image: Postgres (supabase/postgres:) via pg_dumpall, MariaDB (killbill/mariadb) via mariadb-dump. New/renamed DBs on those images are picked up automatically.
  • Fail-loud guard: if discovery finds zero DBs for an engine, exit non-zero (an image change can never silently back up nothing again).
  • Exit non-zero on any failure so cron MAILTO fires.
  • MariaDB password read from the container env (MYSQL_PWD) - no secret in the script.

Tested live on bnet006: all 6 DBs backed up (supabase prod/stage, billing prod/stage, killbill prod/stage MariaDB), exit 0.

The killbill DB was migrated Postgres->MariaDB and renamed (Aug 2025); the hardcoded container name + pg_dumpall meant killbill had NO backup for ~11 months while cron reported success. Also billing-postgres was never backed up. Changes: - **Dynamic discovery by image**: Postgres (supabase/postgres:*) via pg_dumpall, MariaDB (killbill/mariadb*) via mariadb-dump. New/renamed DBs on those images are picked up automatically. - **Fail-loud guard**: if discovery finds zero DBs for an engine, exit non-zero (an image change can never silently back up nothing again). - **Exit non-zero on any failure** so cron MAILTO fires. - MariaDB password read from the container env (MYSQL_PWD) - no secret in the script. Tested live on bnet006: all 6 DBs backed up (supabase prod/stage, billing prod/stage, killbill prod/stage MariaDB), exit 0.
mrouissi merged commit 03739f5ac2 into master 2026-07-01 18:14:13 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Scripts/dbs-backup!1
No description provided.