Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lnsp/pgsql-backup-s3
Small tool that performs a PostgreSQL backup and stores the result in a S3-compatible service.
https://github.com/lnsp/pgsql-backup-s3
aws backup digitalocean-spaces dump postgresql s3
Last synced: 3 months ago
JSON representation
Small tool that performs a PostgreSQL backup and stores the result in a S3-compatible service.
- Host: GitHub
- URL: https://github.com/lnsp/pgsql-backup-s3
- Owner: lnsp
- License: mit
- Created: 2019-05-09T20:03:44.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-25T00:12:42.000Z (almost 2 years ago)
- Last Synced: 2024-06-21T18:10:26.396Z (7 months ago)
- Topics: aws, backup, digitalocean-spaces, dump, postgresql, s3
- Language: Go
- Size: 19.5 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pgsql-backup-s3
[![Build](https://github.com/lnsp/pgsql-backup-s3/workflows/Docker/badge.svg)](https://github.com/lnsp/pgsql-backup-s3/packages)Small tool that performs a PostgreSQL backup and push the dump to an S3-compatible service.
## Environment configuration
| Variable | Description | Default value |
|----------------|------------------------------|----------------------|
| `HOST` | Host parameter for `pg_dump` | `"localhost"` |
| `PORT` | Port parameter for `pg_dump` | `"5432"` |
| `DATABASE` | Database to dump | none |
| `USER` | Access role | `"root"` |
| `PASSWORD` | Access password | `"root"` |
| `PGDUMPBINARY` | Binary location of `pg_dump` | `"/usr/bin/pg_dump"` |
| `ACCESSKEY` | Access key for S3 service | none |
| `SECRETKEY` | Secret key for S3 service | none |
| `ENDPOINT` | S3 endpoint name | none |
| `BUCKET` | S3 bucket identifier | none |
| `PATH` | Backup file path | `""` |
| `PREFIX` | Backup file prefix | `""` |## Run on Kubernetes
If you want to run the prebuilt container on Kubernetes, you are welcomed to do so. In the `/docs` folder you find a `CronJob` manifest example.
## Build from scratch
Since this project supports Go modules, building it from scratch is very straightforward.
```bash
git clone https://github.com/lnsp/pgsql-backup-s3.git
cd pgsql-backup-s3
go build
```