Created
May 30, 2017 08:15
-
-
Save silviorelli/b73ccb3c268b4461e59be71889ce8a77 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/sh | |
if [ $# -ne 2 ]; then | |
echo "Usage: $(basename $0) <heroku-app-name> <local_database_name>" | |
exit -1 | |
fi | |
if heroku pg:backups capture --app $1 ; then | |
if curl -o latest.dump `heroku pg:backups public-url --app $1` ; then | |
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U $USER -d $2 latest.dump | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment