Created
March 21, 2020 13:45
-
-
Save userimack/87cbe4f16120c82361463009c1d2f360 to your computer and use it in GitHub Desktop.
postgresql db dump command - it will dump the database and gzip it before saving it
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 | |
echo "Starting database backup.." | |
pg_dump -Fc --no-acl --no-owner \ | |
<Database Name> \ | |
| gzip > "<dump name>-$(date +%Y%m%d%H%M%S).pgdump.gz" | |
echo "Backup completed.." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment