Code Monkey home page Code Monkey logo

docker-bareos-client's Introduction

Dockerized bareos client

Stolen from https://github.com/barcus/bareos

Usage

Backup Volumes

Start container from image freinet/bareos-client and add volumes to be included into your backup:

docker run -d \
  -p 9102:9102 \
  -e BAREOS_FD_PASSWORD=secret_shared_with_director \
  -v my_volume1:/volumes/my_volume \
  -v my_volume2:/volumes/my_volume2 \
  freinet/bareos-client

Create a corresponding fileset in your bareos director:

FileSet {
  Name = "my_fileset"
  Include {
    Options {
      Signature = MD5
      Compression = LZFAST
      One FS = No
    }
    File = /volumes
  }
}

Backup Mysql using bpipe plugin

Stolen from https://github.com/Brightside56/bareos-client-docker

Start container from image freinet/bareos-client and add the database to be included into your backup by using environment variables:

  • BAREOS_MYSQL_USER (default is root)
  • BAREOS_MYSQL_PASSWORD
  • BAREOS_MYSQL_HOST (default is db)
docker run -d \
  -p 9102:9102 \
  -e BAREOS_FD_PASSWORD=secret_shared_with_director \
  -e BAREOS_MYSQL_USER=root \
  -e BAREOS_MYSQL_PASSWORD=secret \
  -e BAREOS_MYSQL_HOST=db \
  freinet/bareos-client

Create a corresponding fileset in your bareos director:

FileSet{
  Name = "mysql_stream"
  Include {
    Options {
      Signature = MD5
      Compression = LZFAST
      One FS = No
    }
    Plugin = "\\|/etc/bareos/scripts/backup-db"
  }
}

This uses the command plugin which in turn calls the script /etc/bareos/scripts/backup-db on the client. The script then looks up all available databases on the given mysql host and generates bpipe commands for each databse found...

Restore Mysql using bpipe plugin

There are two ways to restore the backup using the method described.

  • Restore direct to the database
  • Restore to dump files

By default, the container attempts to recover the data to the given database by first dropping each database and then recreating it from the backup.

If the container was started with the environment variable BAREOS_MYSQL_RESTORE_PATH then a compressed dump file for each database is written to the given destination.

Example to write the dumps directly to your working directory:

docker run -d \
  -p 9102:9102 \
  -e BAREOS_FD_PASSWORD=secret_shared_with_director \
  -e BAREOS_MYSQL_RESTORE_PATH=`pwd` \
  freinet/bareos-client

Backup Postgres using bpipe plugin

Note: Everything works exactly as for mysql, except for the environment variables being the standard postgres ones, and for the backup script to use in your fileset being called "backup-pg-db".

Start container from image freinet/bareos-client and add the database to be included into your backup by using environment variables:

  • BAREOS_PG_USER (default for superuser is postgres)
  • BAREOS_PG_PASSWORD
  • BAREOS_PG_HOST
docker run -d \
  -p 9102:9102 \
  -e BAREOS_FD_PASSWORD=secret_shared_with_director \
  -e BAREOS_PG_USER=postgres \
  -e BAREOS_PG_PASSWORD=qa$$vvoRb \
  -e BAREOS_PG_HOST=db \
  freinet/bareos-client

Create a corresponding fileset in your bareos director:

FileSet{
  Name = "pgdump_stream"
  Include {
    Options {
      Signature = MD5
      Compression = LZFAST
      One FS = No
    }
    Plugin = "\\|/etc/bareos/scripts/backup-pg-db"
  }
}

Restoration is the same as well, if you don't want to restore directly to the database, set BAREOS_PG_RESTORE_PATH

docker-bareos-client's People

Contributors

sp-fr avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

sp-fr

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.