https://github.com/kloeckner-i/pgdump-gcs
Docker Image for backup postgres and upload to gcs buckets
https://github.com/kloeckner-i/pgdump-gcs
Last synced: 6 months ago
JSON representation
Docker Image for backup postgres and upload to gcs buckets
- Host: GitHub
- URL: https://github.com/kloeckner-i/pgdump-gcs
- Owner: kloeckner-i
- License: mit
- Created: 2020-03-24T15:26:21.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-14T03:08:46.000Z (8 months ago)
- Last Synced: 2024-11-30T05:40:50.366Z (6 months ago)
- Language: Shell
- Size: 14.6 KB
- Stars: 2
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
- License: LICENSE
Awesome Lists containing this project
README
# pgdump-gcs
Small docker container for creating a backup of a psql database and put the dump file on a google cloud storage bucket.
## how to use
```bash
docker run \
-v ./cred:/cred \
-e DB_HOST={db host addess} \
-e DB_NAME={database-name} \
-e DB_PASSWORD_FILE=/cred/my_db_pass_as_file \
-e DB_USERNAME_FILE=/cred/my_db_user_as_file \
-e CREDENTIALFILE=/cred/credential.json \
-e GCS_BUCKET={bucket_name} \
-e PROM_NAMESPACE=kci \
kloeckneri/pgdump-gcs:postgres-11
```## tipps
- create a lifecycle rule to keep your gcs bucket small
- we create also a `_latest` file, so able to access the latest backup with another script## monitoring
Simple curl pushing some basic parameter to a prometheus push gateway.
### metrics
* timestamp
* duration
* size### labels
* job = pgdump-gcs
* source_type = postgresql
* source_name = `${DB_NAME}`