https://github.com/jborrow/postgres-backup
A tiny container for backing up postgres databases in cron jobs
https://github.com/jborrow/postgres-backup
Last synced: 3 months ago
JSON representation
A tiny container for backing up postgres databases in cron jobs
- Host: GitHub
- URL: https://github.com/jborrow/postgres-backup
- Owner: JBorrow
- License: mit
- Created: 2024-08-23T16:35:28.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-08-23T16:45:38.000Z (9 months ago)
- Last Synced: 2024-12-27T06:41:27.672Z (5 months ago)
- Language: Shell
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Simple Postgres Backup
======================A very simple docker container that uses `pg_dumpall` to back
up a database running in a _different_ container. The container
runs once, and so you should exec it inside a cron job (e.g.
inside a kubernetes cron job).Backups are set to have 640 permissions.
Configuration
-------------There are a few important environment variables, *all of which
must be set, there are no defaults*:+ `POSTGRES_USER` - Postgres username to use
+ `POSTGRES_PASSWORD` - Postgres password to use
+ `POSTGRES_PORT` - Postgres port to use
+ `POSTGRES_HOST` - Postgres host to use (e.g. your container name)
+ `BACKUP_LOCATION` - Filesystem location to store all the backups
+ `BACKUP_KEY` - The start of the filename.You should bind-mount a reliable disk into the container with
a directory that you use as `BACKUP_LOCATION`. Dates are automatically
appended and you cannot control the date format. For example,
setting `BACKUP_LOCATION=/backups` and `BACKUP_KEY=mydb_backup`,
you would get backup names of the form:```
/backups/mydb_backup_2024-04-23.sql.gz
```