Created
December 6, 2018 14:37
-
-
Save sergray/4b6f13c2f92395b8dec3c31ba86389f7 to your computer and use it in GitHub Desktop.
dump postgresql DB with specific pg_dump version running in Docker container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pg_version=10.5 pg_user=user db_name=db && \ | |
docker run -it --rm -v /tmp/pgdump:/tmp/pgdump:rw --network=host postgres:$pg_version \ | |
pg_dump -h localhost -U $pg_user -W -f /tmp/pgdump/${db_name}_$(date +%Y%m%d%H%M%S) -Fc -v $db_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment