Skip to content

gregarmer/s3pgbackups

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

s3pgbackups

PostgreSQL cluster backups to Amazon S3.

Build Status

Overview

This application will backup your PostgreSQL cluster to Amazon S3, which includes:

  • Separate SQL pg_dump of each database
  • Compressed data (gzip)
  • Automatically rotated backups
  • Ability to exclude specific tables, or entire databases

Installation

Debian

$ curl -s https://packagecloud.io/install/repositories/gregarmer/packages/script.deb.sh | sudo bash

CentOS (or RHEL / other rpm based distro's)

$ curl -s https://packagecloud.io/install/repositories/gregarmer/packages/script.rpm.sh | sudo bash

Getting Started

  1. Follow the installation steps above.

  2. Configure ~/.s3pgbackups - something like this:

    {
      "aws_access_key": "UBGKJEBGKE56783JHVFW",
      "aws_secret_key": "webgrwebgjwbewegfkeg",
      "s3_bucket": "your.db.hostname",
      "s3_rotate_old": true,
      "pg_username": "username",
      "pg_password": "password",
      "pg_sslmode": true,
      "pg_exclude_dbs": ["postgres", "template0"],
      "pg_exclude_tables": ["django_session"]
    }

    Note: Running s3pgbackups without a config will create a blank config.

  3. Run s3pgbackups

Usage

$ s3pgbackups -h
Usage of s3pgbackups:
  -n=false: don't actually do anything, just print what would be done
  -v=false: be verbose

You can use the -n parameter to put s3pgbackups into no-op mode, where no actions will actually be performed.

The -v parameter will make s3pgbackups be verbose about what is actually happening.

TODO

  • Support for other RDBMS's
  • Support for other targets, besides Amazon S3
  • If we do the above, we should probably rename the project ?
  • Using S3 behind a proxy - depends on this PR

About

Amazon S3 PostgreSQL Cluster Backups

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published