https://github.com/tnoff/database-backup
Database backup script for OCI
https://github.com/tnoff/database-backup
database-backup docker oci
Last synced: about 1 month ago
JSON representation
Database backup script for OCI
- Host: GitHub
- URL: https://github.com/tnoff/database-backup
- Owner: tnoff
- License: bsd-2-clause
- Created: 2024-07-13T15:21:08.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2026-03-31T10:58:23.000Z (about 1 month ago)
- Last Synced: 2026-03-31T12:30:48.476Z (about 1 month ago)
- Topics: database-backup, docker, oci
- Language: Shell
- Homepage:
- Size: 198 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Database Backup
Runs a simple `pg_dump` command and uploads to OCI object storage or S3 Object Storage
## PG Version
Assumes postgres version 16
## Volumes
All backup file data written to `/opt/backup/files` if you want to keep it on a data volume for consistency.
Mount a `cron-env` file to the `/opt/backup/env` directory for all environment vars.
## Environment Variables
For environment variables to be used in the cron job, place environment exports in a `/opt/backup/env/cron-env` file.
Requires:
- `BUCKET_NAME` - bucket in object storage
- `DATABASE_USER` - database user to connect with
- `DATABASE_HOST` - database host to connect to
- `DATABASE_NAME` - name of database
- `PGPASSWORD` - database password
## Object Storage Types
By default the system will default to S3 Object Storage, to override to OCI object storage use:
```
export STORAGE_BACKEND="oci"
```
## OCI Setup
If you want to set oci config files or auth options, place them in the `/opt/backup/env/cron-env` file.
## S3 Setup
Place the relevant environment exports in the `/opt/backup/env/cron-env` file, including:
- `AWS_ENDPOINT_URL_S3`
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`
## Optional Args
Pass in `PGDUMP_ARGS` to allow additional args on the pgdump command.
Pass in `GZIP_ARGS` for additional args on the gzip command.