Giter Site home page Giter Site logo

pg-backupper's Introduction

pg-backupper

Docker image to do scheduled backups of PostgreSQL DBs

This Dockerfile can be used to do daily backups and cleanup archive with a policy like this:

  • Do backups every X hours
  • Keep at least one backup for each of X last days (last backup for all previous days)
  • Keep at least one backup for each of X last weeks (e.g. for each Monday of last 2 weeks)
  • Keep at least one backup for each of X last months (e.g. for each 3d day of any last 5 month)

Configuration

You can have as many connections to backup as you want (maximum number is 99 though) and for each of it you need to have a config like this:

  • BACKUP_NAME_[1..99] - Name which will be used to generate backup files.
  • SCHEDULE_[1..99] - Cron format for running backups (e.g. 23 */3 * * *). Default: 0 0 * * *
  • BACKUP_DIR_[1..99] - Directory to keep backups. Default: /data
  • BACKUP_DB_HOST_[1..99] - DB host to backup. Default: localhost
  • BACKUP_DB_PORT_[1..99] - DB port to backup. Default: 5432
  • BACKUP_DB_NAME_[1..99] - DB name to backup. Default: template1
  • BACKUP_DB_USER_[1..99] - DB use to backup. Default: postgres
  • BACKUP_DB_PASSWORD_[1..99] - DB use to backup. Default: `` (empty string)
  • BACKUP_OPTIONS_[1..99] - options pg_dump utility. Default: `` (empty string)
  • SAFE_DAYS_[1..99] - Number of days when we keep one backup per each day. Default: 7
  • SAFE_WEEKS_[1..99] - Number of weeks when we keep backup per each week. Default: 4
  • SAFE_WEEK_DAY_[1..99] - Name of the Day of the Week to keep backup. Valid values: Monday,Tuesday, Wednesday,Thursday,Friday,Saturday,Sunday Default: Monday
  • SAFE_MONTHS_[1..99] - Number of months when we keep one backup per each month. Default: 6
  • SAFE_MONTH_DATE_[1..99] - Date of any month to keep backup. Valid values: 1-28. Default: 1

In fact Docker container will have cron which will run pg_backup and proceed cleanup of old backups accordingly configs for each of provided connections.

pg-backupper's People

Contributors

jan-moxter avatar paunin avatar janmoxter avatar

Watchers

James Cloos avatar  avatar

Forkers

janmoxter

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.