c2d7fa / postgres-to-b2

Back up Postgres database to B2 storage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create bucket and application keys in B2. It's recommended that you set a prefix for the application key, e.g. database-backup/ so you can share one bucket for multiple backups.

Files are automatically named with the prefix, and also contain the database name and a timestamp. Backups are saved as plain-text SQL files.

$ which pg_dump
/usr/bin/pg_dump
$ export B2_KEY_ID="..."
$ export B2_KEY="..."
$ export PG_HOST="..."
$ export PG_USER="..."
$ export PG_PASSWORD="..."
$ export PG_DATABASE="..."
$ deno run --allow-run --allow-net --allow-env ./main.ts

Build image:

$ docker build . -t c2d7fa/postgres-to-b2:$VERSION && docker push c2d7fa/postgres-to-b2

In Kakoune:

eval %sh{kak-lsp --kakoune -s $kak_session --config ./lsp.toml}
lsp-window-enable

About

Back up Postgres database to B2 storage

License:GNU Affero General Public License v3.0


Languages

Language:TypeScript 97.9%Language:Dockerfile 2.1%