Created
May 20, 2020 07:18
-
-
Save Saka7/8674e300c62c6a3eb6563577bc2b6f14 to your computer and use it in GitHub Desktop.
Create gzip-ed dump of psql database
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
DB_HOST=0.0.0.0 | |
DB_PORT=5432 | |
DB_USER=postgres | |
DB_NAME=postgres | |
DB_SCHEMA=public | |
BACKUP_FILENAME=$DB_SCHEMA | |
# File | |
pg_dump -v -h $DB_HOST -U $DB_USER -d $DB_NAME -W -n $DB_SCHEMA -F c -f $BACKUP_FILENAME.tar.gz | |
# Stream | |
pg_dump -h $DB_HOST -U $DB_USER -d $DB_NAME -W -n $DB_SCHEMA -F c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment