Last active
August 29, 2015 13:56
-
-
Save JohnPreston/9e7ae3e4f18d8911ee10 to your computer and use it in GitHub Desktop.
Dump Eucalyptus DBs
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
#!/usr/bin/env bash | |
# gets the list of DBs | |
$DBS = psql -h /var/lib/eucalyptus/db/data -p 8777 -l | awk '{print $1}' | grep euca | |
#creates the dumps | |
for db in $DBS ; do pg_dump -c -o -h /var/lib/eucalyptus/db/data -p 8777 -U root $db > $db-`date +%Y-%m-%d_%Hh%M`.sql ; done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment