Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

postgres-backup

Dumps a PostgreSQL database and uploads it, gzipped, to an AWS S3 bucket.

Postgres twin of softonic/mysql-backup. Used by the postgres-backup Helm chart to back up Cloud SQL PostgreSQL instances outside of Google, so backups do not depend solely on GCP.

Environment variables

Variable Required Default Description
POSTGRES_HOST yes — Database host
POSTGRES_PORT no 5432 Database port
POSTGRES_DATABASE yes — Database to dump
POSTGRES_USER yes — Database user
POSTGRES_PASSWORD yes — Database password
AWS_ACCESS_KEY_ID yes — AWS credentials
AWS_SECRET_ACCESS_KEY yes — AWS credentials
AWS_S3_BUCKET yes — Destination bucket
AWS_S3_FILE_PREFIX yes — Object key prefix; uploads <prefix>-<epoch>.sql.gz
AWS_ENDPOINT_URL no — Override the S3 endpoint (MinIO and friends)

Usage

docker run --rm \
    -e POSTGRES_HOST=10.221.112.134 \
    -e POSTGRES_DATABASE=sonarDB \
    -e POSTGRES_USER=backup \
    -e POSTGRES_PASSWORD=... \
    -e AWS_ACCESS_KEY_ID=... \
    -e AWS_SECRET_ACCESS_KEY=... \
    -e AWS_S3_BUCKET=pgdump-softonic-infrastructure \
    -e AWS_S3_FILE_PREFIX=sonarqube/sonarqube \
    softonic/postgres-backup:0.1.0

The bundled pg_dump is version 15, which supports PostgreSQL 14 and 15 servers.

About

Dump a PostgreSQL database to AWS S3. Postgres counterpart of softonic/mysql-backup.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages