Skip to content

Instantly share code, notes, and snippets.

@JohnPreston
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JohnPreston/9e7ae3e4f18d8911ee10 to your computer and use it in GitHub Desktop.
Save JohnPreston/9e7ae3e4f18d8911ee10 to your computer and use it in GitHub Desktop.
Dump Eucalyptus DBs
#!/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