Add automated PostgreSQL dumps for Cosmos #123

Closed
opened 2026-07-30 22:22:35 +01:00 by nimmo · 0 comments
Owner

Goal

Provide set-and-forget, application-consistent PostgreSQL backups for Cosmos that are automatically consumed by Backrest.

Scope

  • Add a scheduled backup service and timer on Cosmos.
  • Dump PostgreSQL globals/roles and every non-template, connectable database discovered at runtime.
  • Write one compressed, date-stamped dump per database plus a globals dump.
  • Use a temporary staging directory and atomic promotion so Backrest never sees partial backups.
  • Retain seven completed local backup sets and prune older sets.
  • Add the completed backup directory to Cosmos Backrest extraPaths.
  • Record a manifest for each backup set and fail visibly if any dump fails.
  • Ensure new databases are picked up automatically and decommissioned databases age out naturally.

Acceptance criteria

  • A new database appears in the next scheduled backup without configuration changes.
  • A dropped database stops appearing after the seven-day local retention window.
  • A failed dump does not replace the last known-good backup set.
  • Backrest archives the completed dump sets to the encrypted NAS repository.
  • The restore procedure is documented and tested against a disposable PostgreSQL instance.
  • Configuration validation and relevant shell/regression tests pass.
## Goal Provide set-and-forget, application-consistent PostgreSQL backups for Cosmos that are automatically consumed by Backrest. ## Scope - Add a scheduled backup service and timer on Cosmos. - Dump PostgreSQL globals/roles and every non-template, connectable database discovered at runtime. - Write one compressed, date-stamped dump per database plus a globals dump. - Use a temporary staging directory and atomic promotion so Backrest never sees partial backups. - Retain seven completed local backup sets and prune older sets. - Add the completed backup directory to Cosmos Backrest extraPaths. - Record a manifest for each backup set and fail visibly if any dump fails. - Ensure new databases are picked up automatically and decommissioned databases age out naturally. ## Acceptance criteria - A new database appears in the next scheduled backup without configuration changes. - A dropped database stops appearing after the seven-day local retention window. - A failed dump does not replace the last known-good backup set. - Backrest archives the completed dump sets to the encrypted NAS repository. - The restore procedure is documented and tested against a disposable PostgreSQL instance. - Configuration validation and relevant shell/regression tests pass.
nimmo closed this issue 2026-09-10 22:10:53 +01:00
Sign in to join this conversation.
No milestone
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
nimmo/nixos-config#123
No description provided.