Created
October 23, 2013 15:49
-
-
Save jimdalbano/7121232 to your computer and use it in GitHub Desktop.
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/sh | |
#for db in commercialads_dev emberrailsapi_dev; do | |
# pg_dump -h pg-local -U postgres "$db" > "$db"_dump | |
#done | |
#list=`psql -l | awk '{ print $1}' | grep -vE '^-|^List|^Name|template[0|1]'` | |
list=`psql -h pg-local -U postgres -l | awk '{ print $1}' | grep -vE '^-|^\||^List|^Name|template[0|1]|postgres|^\('` | |
for lis in $list; do | |
echo dumping $lis .... | |
pg_dump -h pg-local -U postgres "$lis" > dumps/"$lis"_dump | |
echo '..... dumped\n' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment