PostgreSQL cluster backups to Amazon S3.
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
$ curl -s https://packagecloud.io/install/repositories/gregarmer/packages/script.deb.sh | sudo bash
$ curl -s https://packagecloud.io/install/repositories/gregarmer/packages/script.rpm.sh | sudo bash
-
Follow the installation steps above.
-
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.
-
Run
s3pgbackups
$ 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.
- 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