Last active
December 15, 2015 21:59
-
-
Save wrought/5329447 to your computer and use it in GitHub Desktop.
backup postgres db with --inserts flag so it is easier to git track (instead of multiple snapshots, track snapshots with git)
This file contains hidden or 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 | |
host="host" | |
user="pg_user" | |
port=1000 | |
dbname="dbname" | |
# the "no-password" flag requires a .pgpass file with a password, to avoid being prompted for a password | |
pg_dump -h $host -U $user -p $port --no-password --inserts $dbname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment