Skip to content

Instantly share code, notes, and snippets.

@azaitsev
azaitsev / pg_b2_backup.sh
Last active August 10, 2022 15:26 — forked from schnapster/pg_b2_backup.sh
Backup postgres database to backblaze b2
#!/bin/bash
# this requires the backblaze CLI tool to be installed (pip install b2)
# pass 4 args:
# - database name (needs to exist in postgres)
# - bucket name (target of the upload)
# - file containing b2 credentials (it will be sourced and needs to set B2_ACCOUNT_ID and B2_APP_KEY)
#
# example: ./pg_b2_backup.sh db backups-daily ~/b2_creds
#