GithubHelp home page GithubHelp logo

postgresql-backup-dropbox's Introduction

postgresql-backup-dropbox

Backup PostgreSQL to Dropbox (supports periodic backups & multi files)

Basic Usage

$ docker run \
  --name postgresql_backup \
  -d \
  --restart=always \
  --log-opt max-size=1m \
  --log-opt max-file=5 \
  -e POSTGRESQL_USER=root \
  -e POSTGRESQL_PASSWORD=root \
  -e POSTGRESQL_HOST=localhost \
  -e DROPBOX_ACCESS_TOKEN=YOUR_TOKEN \
  -e SCHEDULE=@daily \
  -e DATABASE_NAME=databasename
  diogoarm/postgresql-backup-dropbox

Environment variables

  • POSTGRESQLDUMP_OPTIONS pg_dump options
  • POSTGRESQL_HOST the postgresql host required
  • POSTGRESQL_PORT the postgresql port (default: 5432)
  • POSTGRESQL_USER the postgresql user required
  • POSTGRESQL_PASSWORD the postgresql password required
  • DROPBOX_PREFIX path prefix in your Dropbox (default: empty)
  • DROPBOX_ACCESS_TOKEN your Dropbox API access token required
  • SCHEDULE backup schedule time, see explainatons below
  • DATABASE_NAME the postgresql databasename required

Automatic Periodic Backups

You can additionally set the SCHEDULE environment variable like -e SCHEDULE="@daily" to run the backup automatically.

More information about the scheduling can be found here.

How to get Dropbox API token

Visit the Dropbox app creation page, and fill following fields in there.

  1. Choose an API ... Dropbox API
  2. Choose the type of access you need ... App folder
  3. Name your app ... Your favorite name. This will be a folder name.

Once an application have created, you should press "Generate" button to generate your access token:

postgresql-backup-dropbox's People

Contributors

diogoarm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.