Skip to content

Add postgres backup script for alert-api DB#32

Open
MateoLostanlen wants to merge 5 commits intomainfrom
add-postgres-backup-script
Open

Add postgres backup script for alert-api DB#32
MateoLostanlen wants to merge 5 commits intomainfrom
add-postgres-backup-script

Conversation

@MateoLostanlen
Copy link
Copy Markdown
Member

Summary

Adds bin/backup_postgres.sh to dump the alert-api postgres DB to a local backups/ directory.

  • Server IP resolved from Ansible inventory (no hardcoded IP)
  • DB name and user read from the remote .env (no hardcoded creds)
  • Falls back to pyro-ansible docker container if ansible-inventory isn't on PATH
  • Writes to a temp file and only renames after pg_dump succeeds + size check passes
  • backups/ is gitignored

Usage

make prepare
./bin/backup_postgres.sh

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