Skip to content

Instantly share code, notes, and snippets.

@glsignal
Created September 18, 2013 05:30
Show Gist options
  • Select an option

  • Save glsignal/6604923 to your computer and use it in GitHub Desktop.

Select an option

Save glsignal/6604923 to your computer and use it in GitHub Desktop.
Download a snapshot of all Postgres instances associated with your Heroku apps, installing the pgbackups in the process.
heroku apps | sed -e "s/^===.*$//" | sed "/^$/d" | cut -d " " -f 1 | while read f; do echo $f && heroku addons:add pgbackups --app $f ; heroku pgbackups:capture --app $f && curl -o "${f} $(date).pgbackup" $(heroku pgbackups:url --app $f); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment