Last Updated: February 25, 2016
·
388
· jamesmartin

One-liner: Destroy all Heroku Postgres Backups

heroku pgbackups output looks something like this:

ID    Backup Time                Status                                Size    Database
----  -------------------------  ------------------------------------  ------  ------------------------------------------
b369  2013/09/02 00:12.19 +0000  Finished @ 2013/09/02 00:12.50 +0000  46.1MB  HEROKU_POSTGRESQL_BROWN_URL (DATABASE_URL)

You can delete every backup, with this one-liner:

heroku pgbackups --app <app-name> | sed -e '1,2d' | awk '{print $1}' | xargs heroku pgbackups:destroy --app <app-name>