Skip to content

Instantly share code, notes, and snippets.

@zhm
Created March 2, 2012 06:32
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 zhm/1956242 to your computer and use it in GitHub Desktop.
Save zhm/1956242 to your computer and use it in GitHub Desktop.
for file in ~/postgres_backups/*
do
dbname=$(basename $file | sed s/\.gz//g)
createdb $dbname
gunzip -c $file | sed 's/Library\/PostgreSQL\/9.0\/lib\/postgis-1.5/usr\/local\/Cellar\/postgresql\/9.1.3\/lib\/postgis-1.5/g' | psql $dbname
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment