Skip to content

A container which provides the ability to backup a PostgreSQL database to Minio on demand

Notifications You must be signed in to change notification settings

AntonOfTheWoods/minback-postgres

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

minback-postgres

Minio Backup container for PostgreSQL

This container provides a trivially simple means to run pg_dump and fire the results off to a Minio instance. It is intended to be run in conjunction with a Kubernetes CronJob to maintain a frequent backup of your critical data with minimal fuss.

Features

  • Dumps a single PostgreSQL database to an S3 bucket
  • Lightweight and short lived
  • Simple and readable implementation

Example

docker run --rm --env-file backup.env minback/postgres my_db -h pgserver1

backup.env

MINIO_SERVER=https://play.minio.io/
MINIO_ACCESS_KEY=minio
MINIO_SECRET_KEY=miniosecret
MINIO_BUCKET=backups

Usage

DB_NAME [OPTIONS...]

Arguments
  DB_NAME  - The name of the database you wish to backup
  OPTIONS  - Any additional options you wish to pass to pg_dump

Configuration

This container is configured using environment variables, enabling it to easily be started manually or automatically and integrate well with Kubernetes' configuration framework.

MINIO_SERVER=https://play.minio.io/

The Minio server you wish to send backups to.

MINIO_ACCESS_KEY=minio

The Access Key used to connect to your Minio server.

MINIO_SECRET_KEY=miniosecret

The Secret Key used to connect to your Minio server.

MINIO_BUCKET=backups

The Minio bucket you wish to store your backup in.

DATE_FORMAT=+%Y-%m-%d

The date format you would like to use when naming your backup files. Files are named $DB-$DATE.archive.

About

A container which provides the ability to backup a PostgreSQL database to Minio on demand

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 75.3%
  • Dockerfile 24.7%