Created
May 24, 2012 01:59
-
-
Save croaky/2779013 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 | |
| load-production() { | |
| backup-production | |
| get-backup | restore-from-backup | |
| } | |
| backup-production() { | |
| heroku pgbackups:capture --expire `heroku-production` | |
| } | |
| get-backup() { | |
| curl -o `production-backup-url` | |
| } | |
| restore-from-backup() { | |
| pg_restore --verbose --clean --no-acl --no-owner -d `local-database-name` | |
| } | |
| production-backup-url() { | |
| printf "heroku pgbackups:url `heroku-production`" | |
| } | |
| local-database-name() { | |
| printf "`current-directory`_development" | |
| } | |
| heroku-production() { | |
| printf "--app `current-directory`-production" | |
| } | |
| current-directory() { | |
| pwd | awk -F'/' '{print $NF}' | |
| } |
Cool. Thanks, Prem.
…On Thu, May 24, 2012 at 9:59 AM, Prem Sichanugrist ***@***.*** wrote:
Dan, on line 13 you don't need `-o`. Otherwise everything looks fine (except there're too many functions that're so risky to be overridden.)
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/2779013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dan, on line 13 you don't need
-o. Otherwise everything looks fine (except there're too many functions that're so risky to be overridden.)