Run periodic SQL dumps from postgres and (optionally) upload them to GCS
4.1K
This image runs a periodic dump of your PostgreSQL database (using the
pg_dumpall utility), and (optionally) uploads the dumps to GCS.
It's based on unit9/cron and follows the daily schedule (dumps at
6:25 AM).
It's using the 9.6 version of Postgres tools, as found in Debian Jessie backports, which should support every version of the server, all the way back to 7.0 or so.
Backups are stored in /var/backups, and are automatically compressed
with gzip.
if GS_PATH is not empty, the GCS upload job will start after the
backup job has finished, and will remove each file after successful
upload.
If you're not using the included GCS integration, you may want to
mount a persistent volume on /var/backups and/or handle offsite
backups some other way.
Defaults are as follows:
PGUSER: postgresPGPASSWORD: postgresPGHOST: postgresPGPORT: 5432BOTO_PATH: emptyGS_PATH: emptyGOOGLE_APPLICATION_CREDENTIALS: emptyEverything PG* behaves exactly as described in
Postgres docs.
If you want to use the GCS integration, you will have to:
Provide the credentials
Set GS_PATH, e.g. gs://my-test-bucket/backups/
You can do one of the following:
(Only when running on GCE) Use the default service account;
Put a JSON file with credentials somewhere (e.g.
/var/run/secrets/gce/secret.json), and set
GOOGLE_APPLICATION_CREDENTIALS to point to it;
Mount /etc/boto.cfg (or set BOTO_PATH)
Content type
Image
Digest
Size
99.7 MB
Last updated
over 9 years ago
docker pull unit9/postgres-dumper