https://github.com/chnbohwr/docker-pg_dump
320
Docker image with pg_dumpall running as a cron task
Attach a target postgres container to this container and mount a volume to container's /dump folder. Backups will appear in this volume. Optionally set up cron job schedule (default is 0 1 * * * - runs every day at 1:00 am).
docker run -d \
-v /path/to/target/folder:/dump \
-e CRON_SCHEDULE='0 1 * * *' \
-e PGUSER=postgres \
-e PGPASSWORD=mysecretpassword \
-e PGHOST=localhost \
-e EXPIRE_DAYS=10
chnbohwr/pg_dumpall dump-cron
to restore data use
psql -f dump-20211014_140501.sql -U postgres
Content type
Image
Digest
sha256:5143d8b49…
Size
165.6 MB
Last updated
almost 4 years ago
docker pull chnbohwr/pg_dumpall