Created
December 6, 2018 20:31
-
-
Save arthuralvim/3deaa6967b873f65327806439fbac204 to your computer and use it in GitHub Desktop.
Just a script to work and sync heroku backups with s3.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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