Skip to content

Instantly share code, notes, and snippets.

@arthuralvim
Created December 6, 2018 20:31
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 arthuralvim/3deaa6967b873f65327806439fbac204 to your computer and use it in GitHub Desktop.
Save arthuralvim/3deaa6967b873f65327806439fbac204 to your computer and use it in GitHub Desktop.
Just a script to work and sync heroku backups with s3.
# install awscli and heroku cli before.
# sudo pip install awscli
#
sudo su
curl https://cli-assets.heroku.com/install.sh | sh
exit
heroku login --interactive
heroku apps
for app in app-name1 app-name2 app-name3; do
heroku pg:backups:capture --app=$app
heroku pg:backups:download --app=$app --output="${app}.dump"
done
aws configure
aws s3 sync . s3://path/to/backups/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment