Skip to content

isutare412/postgres-dumper

Repository files navigation

Postgres Dumper

Backup your PostgreSQL to AWS S3 periodically. You can use linux crontab or k8s cronjob.

This repository was copied from a backup module of Web Memo due to its feature independentness.

Usage

# Prepare your own config
cat <<EOF >> config.local.yaml
process-timeout: 10m
log:
  format: <format> # text / json
  level: <level> # debug / info / warn / error
aws:
  access-key: <access_key>
  secret: <secret_access_key>
  region: <aws_region>
  s3:
    backup-bucket: <bucket>
backup:
  prefix: <object_prefix>
  retention: 720h # 30 days
postgres:
  host: localhost
  port: 5432
  user: <user>
  password: <password>
  database: <database_name>
EOF

make run

Deployment (CronJob)

# Prepare your own values
cat <<EOF >> my_values.yaml
config:
  aws:
    access-key: <access_key>
    secret: <secret_access_key>
    region: <region>
# ...
EOF

helm upgrade --install postgres-dumper ./helm/postgres-dumper -f my_values.yaml

About

Backup your PostgreSQL to AWS S3

Resources

Stars

Watchers

Forks

Packages

No packages published