Backup and restore your postgres database's to using awscli
100K+
Based on https://github.com/cycloidio/cycloid-images/tree/master/mysql-dump
container to backup and restore your PostgreSQL database's from/to AWS or Scaleway. Could be use with docker or in K8s.
cron to make backups if started through the default entrypointaws CLI the file can be uploaded to AWS S3 Storagerclone the file can be uploaded to SCW Object Storage./restore path/inside-bucket/example.sql.gz
./backup
| Env var name | Description |
|---|---|
PGHOST | Host where PostgreSQL is running. default localhost. For example with k8s $(POSTGRES_SERVICE_HOST) |
PGPORT | Port to connect to PostgreSQL. default 5432. For example with k8s $(POSTGRES_SERVICE_PORT) |
PGUSER | The username to connect with PostgreSQL |
PGPASSWORD | The password to connect with PostgreSQL |
PGDATABASE | Database used |
FILENAME | Name to file in bucket storage. Default name backup_%Y-%m-%d_%H-%M-%S output example backup_2015-08-03_17-58-22 |
BACKUP_DIR | Internal pod directory to use when creating the backup, this directory can be mouted via a volume if necessary |
BACKUP_TIME | Time use crontab format to run a dump. default 0 5 * * * (5 am) |
AWS_ACCESS_KEY_ID | AWS access key ID (used to access to the S3 bucket) |
AWS_SECRET_ACCESS_KEY | AWS secret access key |
AWS_S3_BUCKET | AWS S3 bucket to store the PostgreSQL dumps |
AWS_DEFAULT_REGION | AWS region of the S3 bucket |
SCW_ACCESS_KEY | SCW access key (used to access to the Scaleway Object Storage bucket) |
SCW_SECRET_KEY | SCW secret key |
SCW_DEFAULT_ORGANIZATION_ID | SCW default organization ID |
SCW_DEFAULT_REGION | SCW region of the Object Storage bucket |
sudo docker build -t cycloid/postgres-dump .
sudo docker push cycloid/postgres-dump
Content type
Image
Digest
sha256:044b36cb4…
Size
270.9 MB
Last updated
11 months ago
docker pull cycloid/postgres-dump