Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 635
user1916780 Avatar asked Dec 19 '12 19:12

user1916780


People also ask

How do I backup my Heroku database?

Capturing Logical Backups on Larger Databases Create a short-lived fork of your Heroku Postgres database. Create a script to run the pg_dump command and transfer the backup file to the destination of your choice. The following pg_dump command creates a backup file that is the same format as the Heroku PGBackups output.

What is heroku PG?

Heroku Postgres is a managed SQL database service provided directly by Heroku. You can access a Heroku Postgres database from any language with a PostgreSQL driver, including all languages officially supported by Heroku.

How does Heroku Postgres rollback work?

Heroku Postgres rollback “rolls back” the state of your database to a previous point. Rollback doesn't affect your primary database. It follows the same pattern as fork: rollback provisions a new database that isn't directly connected to the primary in any way.


2 Answers

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.

like image 130
Todd A. Jacobs Avatar answered Sep 20 '22 18:09

Todd A. Jacobs


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.

like image 25
Neil Middleton Avatar answered Sep 23 '22 18:09

Neil Middleton