Skip to content

Cron-automated Postgres backup running on Docker

License

wzkun/postgres-backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

postgres-backup

Cron-automated Postgres backup running on Docker

Clone project

git clone git@github.com:rspective/postgres-backup.git
cd postgres-backup

Image build

You need to be logged in your Docker Hub account locally

docker build ./
docker tag [IMAGE_ID] rspective/postgres_backup:[TAG_NAME]
docker push rspective/postgres_backup

Using image

All variables are required, there is no default values

service_name:
    image: rspective/postgres_backup:[TAG_NAME]
    container_name: [CUSTOM_NAME]
    links:
      - pg # link your DB from other service
    environment:
      - POSTGRES_HOST=pg # DB alias
      - POSTGRES_PORT=5432 # DB port
      - POSTGRES_USER=db_username
      - POSTGRES_PASSWORD=db_password
      - POSTGRES_DB=db_name
      - CRON_TIME= */1 * * * * # CRON settings, max resolution - once in a minute
      - MAX_BACKUPS=30 # if there is more backup files than limit, the oldest one will be removed
      - SLACK_WEBHOOK=https://hooks.slack.com/services/123123123/123123123/kjqekqjweSAddaS23eadsDAS # if set you will see notifications from success and failure
    volumes:
      - ./database/backup:/backup # backup files
      - ./database/failed:/_failed # failure logs

Helpful links

About

Cron-automated Postgres backup running on Docker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •