Browse Source

Add POSTGRES_EXTRA_OPTS env variable to postgres-backup-s3

Add optional env variable that can be used to pass extra options
to pg_dump, such as restrict the set of tables dumped.
pull/23/head
Santiago Palladino 8 years ago
parent
commit
2f4238f8b4
  1. 1
      postgres-backup-s3/Dockerfile
  2. 2
      postgres-backup-s3/backup.sh

1
postgres-backup-s3/Dockerfile

@ -9,6 +9,7 @@ ENV POSTGRES_HOST **None**
ENV POSTGRES_PORT 5432 ENV POSTGRES_PORT 5432
ENV POSTGRES_USER **None** ENV POSTGRES_USER **None**
ENV POSTGRES_PASSWORD **None** ENV POSTGRES_PASSWORD **None**
ENV POSTGRES_EXTRA_OPTS ''
ENV S3_ACCESS_KEY_ID **None** ENV S3_ACCESS_KEY_ID **None**
ENV S3_SECRET_ACCESS_KEY **None** ENV S3_SECRET_ACCESS_KEY **None**
ENV S3_BUCKET **None** ENV S3_BUCKET **None**

2
postgres-backup-s3/backup.sh

@ -49,7 +49,7 @@ export AWS_SECRET_ACCESS_KEY=$S3_SECRET_ACCESS_KEY
export AWS_DEFAULT_REGION=$S3_REGION export AWS_DEFAULT_REGION=$S3_REGION
export PGPASSWORD=$POSTGRES_PASSWORD export PGPASSWORD=$POSTGRES_PASSWORD
POSTGRES_HOST_OPTS="-h $POSTGRES_HOST -p $POSTGRES_PORT -U $POSTGRES_USER"
POSTGRES_HOST_OPTS="-h $POSTGRES_HOST -p $POSTGRES_PORT -U $POSTGRES_USER $POSTGRES_EXTRA_OPTS"
echo "Creating dump of ${POSTGRES_DATABASE} database from ${POSTGRES_HOST}..." echo "Creating dump of ${POSTGRES_DATABASE} database from ${POSTGRES_HOST}..."

Loading…
Cancel
Save