Skip to content

Instantly share code, notes, and snippets.

@linxuedong
Last active December 25, 2018 02:56
Show Gist options
  • Save linxuedong/2a0bdd9df4df239128d7fc655b992222 to your computer and use it in GitHub Desktop.
Save linxuedong/2a0bdd9df4df239128d7fc655b992222 to your computer and use it in GitHub Desktop.
Heroku postgres

APP_NAME: heroku app name 例如:sushi
DATABASE_URL: global name for postgres add-on 例如:postgresql-curly-xxx

Creating a backup

创建备份
heroku pg:backups:capture --app APP_NAME

Scheduling backups

heroku pg:backups:schedule DATABASE_URL --at '02:00 America/Los_Angeles' --app APP_NAME

Checking backup status

检查备份状态
heroku pg:backups --app APP_NAME

Restore backup

修复备份
heroku pg:backups:restore b101 DATABASE_URL --app APP_NAME

Restore backup

修复备份
heroku pg:backups:restore b101 postgresql-curly-XXX --app my_app_name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment