Can I schedule backups using the Heroku PG Backup add-on?

*爱你&永不变心* 提交于 2019-12-08 18:00:48

问题


I have been using PG Backups add-on recently and everything has worked fine, however this morning the backup process triggered at 10:00 A.M. in the morning generating some blocks and timeouts in my application.

Is there a way to specify the schedule of the backups made with this add-on? I've been searching and haven't found anything specific.


回答1:


Use Cron for Manual Backup Scheduling

Heroku gives you two types of backups: automated and user-initiated. Each plan has a different number of daily, weekly, and manual backups that are retained. You can't control when the automated backups occur with PG Backups Auto, but you can use cron to trigger a "manual" backup at any time.

For example:

# Trigger a "manual" backup every four hours.
0 */4 * * * source $HOME/database_credentials; heroku pgbackups:capture

See Creating a Backup for more information about using the pgbackups command.




回答2:


No, there is no way to do it currently, aside from using an external process to fire the calls.

An email to support might reveal more.




回答3:


While the original question is old, Heroku does have a schedule option for PGBackups now:

https://devcenter.heroku.com/articles/heroku-postgres-backups#scheduling-backups



来源:https://stackoverflow.com/questions/13959441/can-i-schedule-backups-using-the-heroku-pg-backup-add-on

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!