Skip to content

Instantly share code, notes, and snippets.

@ecarreras
Created June 25, 2012 13:01
Show Gist options
  • Save ecarreras/2988451 to your computer and use it in GitHub Desktop.
Save ecarreras/2988451 to your computer and use it in GitHub Desktop.
for DB in `psql -lAt | grep -v 'eduard' | cut -d '|' -f1`; do if [ -f $DB.sql.bz2 ]; then echo "$DB already dumped"; else echo "Dumping and bziping $DB"; pg_dump $DB | bzip2 | pv > $DB.sql.bz2; fi done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment