This tools use pg_dump to backup a postgres instance and send result to object
storage. It focus on backuping big database with a little memory usage. It use a
fixed memory buffer that correspond to the multipart upload size. This tools
expose many through a prometheus endpoint.
SCHEDULE: cron like scheduling definition. Default to20 2 * * *
Environment variables for PostgreSQL can be used to configure access to database: https://www.postgresql.org/docs/12/libpq-envars.html
At least following variables must be defined:
PGHOSTPGPORTPGUSERPGPASSWORD
Optional variables:
EXCLUDE_DATABASES: Regexp to exclude databases. Default to.*backup.*|postgres|rdsadmin|rdb|template.*
RETENTION_DAYS: Retention in days. Backups older than this value will be deleted. Default to15.BUFFER_SIZE: Size of the main buffer, this parameter affect backup speed and memory usage. Default to10 MB.ENCRYPTION_PASSPHRASE: Passphrase used to encrypt the backups with GPG. If omitted, encryption is disabled. Default to"".BACKUP_ROLES: Backup all roles from the PostgreSQL server, without password. Default totrue.
The following variables are mandatory:
AWS_ENDPOINT_URL: Object storage endpoint, examplehttp://minio:9000.AWS_DEFAULT_REGION: Object storage region.AWS_S3_BUCKET: Object storage bucket name.AWS_ACCESS_KEY_ID: Object storage access key.AWS_SECRET_ACCESS_KEY: Object storage secret key.
Optional variables:
AWS_S3_PREFIX: Path in bucket. Default to a empty string.
METRICS_PORT: prometheus endpoint port. Default to9352
PG253 allows you to symmetrically encrypt your backups with GPG. To enable this feature, you must configure the environment variable ENCRYPTION_PASSPHRASE. If omitted, backups will not be encrypted.
To restore an encrypted backup, you must first decrypt it with a standard GPG binary:
gpg --output mydatabase.dump --decrypt mydatabase-encrypted.dump