Created
January 21, 2019 10:21
-
-
Save adw0rd/80f0240aa865767d988c1831579d393b to your computer and use it in GitHub Desktop.
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/sh | |
for db in `psql -qtc 'SELECT datname from pg_database' | grep -v template`; | |
do pg_dump -Fc $db | gzip -9 > $db.sql.gz; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Work under postgres user
"sudo su - postgres"