Skip to content

Instantly share code, notes, and snippets.

@aitor
Created June 19, 2012 13:29
Show Gist options
  • Save aitor/2954178 to your computer and use it in GitHub Desktop.
Save aitor/2954178 to your computer and use it in GitHub Desktop.
# Because you know, db:pull is fucking slow...
function backup:pull () {
name=$(heroku info --raw | grep "^name=" | cut -d= -f2)
echo "Loading '$name' app's data in local database."
heroku pgbackups:capture --expire
curl -o latest.dump `heroku pgbackups:url`
pg_restore --verbose --clean --no-acl --no-owner -d $name latest.dump
rm -fr latest.dump
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment