Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pgbackup

pgbackup is a Go tool that takes a backup of a postgres cluster periodically and saves it into an S3 (Minio) server.

Prerequisites

This package assumes that the postgresql-client package is intalled as it relies on pg_basebackup to take a snapshot of a cluster.

Configurations

  1. Should take a list of clusters that will be backed up. Create a clusters.json file in the current directory with the following format.
    [
        {
            "ClusterName": "",
            "Host": "",
            "Port": 5432,
            "Password": "",
            "Username": "",
            "RetainDays": 1
        },
        ...
    ]
  2. Should take in configurations for the S3 server, with permissions to create objects in a bucket. Create a .env file in the current directory with the following.
    # Directory where the backups would be stored
    BACKUP_DIR='./backups'
    S3_ENDPOINT=''
    S3_ACCESS_KEY=''
    S3_SECRET_KEY=''
    S3_BUCKET_NAME=''

Running the Docker container

To run the Docker container, use the following command:

docker run -v /path/to/my/.env:/root/.env -v /path/to/my/clusters.json:/root/clusters.json --network=host ghcr.io/ianminash/pgbackup

About

Backup a postgres cluster into an S3 server periodically.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages