mirror of
https://github.com/monobilisim/pgsql-backup.git
synced 2026-04-26 02:35:50 +03:00
No description
| .github/workflows | ||
| backup | ||
| config | ||
| log | ||
| notify | ||
| .gitignore | ||
| .goreleaser.yaml | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| pgsql-backup.iml | ||
| README.md | ||
| README.tr.md | ||
Table of Contents
Features
- Backs up and encrypts all databases or a custom list of databases.
- Supports local backups and cloud storage options like S3 or Minio.
- Option to remove old local backups for efficient storage management.
- Provides notifications through email for monitoring backups.
Usage
-
Configure pgsql-backup by editing the config file (default is
/etc/pgsql-backup.yml) -
Run the backup using the following command as the postgres user:
pgsql-backup
Backups will be created for each database based on the configuration. For local backups, ensure that you define a backup folder with appropriate permissions.
Dependencies
- p7zip
Configuration
The configuration file is in YAML format. The available options are:
backupDestination- Local backup folder pathdatabases- List of database names to back up, if empty all databases are backed upremoveLocal- Remove old local backups if truearchivePass- Password to use for encrypting backups with 7zs3- S3 configuration for backupsminio- Minio configuration for backupsnotify- Email and webhook url notification configurationlog- Logging configuration
See config/config.sample.yml for an example configuration file.
Building
To build pgsql-backup:
CGO_ENABLED=0 go build -ldflags '-extldflags "-static"'
License
pgsql-backup is GPL-3.0 licensed. See LICENSE file for details.