Code Monkey home page Code Monkey logo

docker-obnam's Introduction

Obnam docker image

This docker image contains the backup tool Obnam v1.21.

You can find it here:

It is a modification of vdemeester/obnam with less magic, an option to set custom arguments and a bit more docs).

Default usage

By default, the image will run obnam binary and backup /source to /dest (directories inside Docker container):

$ docker run --rm \
  -v <SOURCE>:/source:ro \
  -v <DEST>:/dest \
  maxhq/obnam

... executes the following command inside the Docker container:

$ obnam backup /source /dest
# Effectively this means:
# obnam backup <SOURCE> <DEST>

You have to replace <SOURCE> and <DEST> with your real host directories!

Customization

If any arguments are given to the Docker container, those are passed on to obnam 1:1 and no magic takes place:

Example 1: version

$ docker run maxhq/obnam --version
1.19.1

Example 2: list keys

$ docker run --rm \
  -v <DEST>:/dest \
  maxhq/obnam list-keys -r /dest

... executes the following command inside the Docker container:

$ obnam list-keys -r /dest
# Effectively this means:
# obnam list-keys -r <DEST>

Usage

Configuration file

Example: you created an Obnam config file on your Docker host at /home/tux/myobnam.cfg. Obnam (in the container) searches several places for config files, firstly /etc/obnam.conf. So the easiest way to pass your config is:

$ docker run --rm \
  -v /home/tux/myobnam.cfg:/etc/obnam.conf:ro \
  ...

Local destination

Your Host filesystem:

  • Source: /home/tux/Documents
  • Target: /mnt/mycloud

You have to tell Docker to mount these source and destination host directories to /source and /dest respectively inside the Docker container. Let's mount the source as read-only to be sure it does not get messed up.

$ docker run --rm \
  -v /home/tux/Documents:/source:ro \
  -v /mnt/mycloud:/dest \
  maxhq/obnam

Remote (SFTP) destination

To backup to an sftp target, we will need to customize the obnam call, preventing all magic and mount:

  • ~/Documents to /source
  • ~/.ssh/ to /root/.ssh/ (to be able to use ssh keys)
$ docker run --rm --ti \
  -v ~/Documents:/source:ro \
  -v ~/.ssh/:/root/.ssh/:ro \
  maxhq/obnam backup -r sftp://backup.host/backup/destination /source

Encryption using GnuPG

To use GPG keys for encryption, they have to made available to the Docker container.

Let's say you set up this ~/myobnam.conf on your host:

[config]
repository = /dest
client-name = sigurd
one-file-system = 1
encrypt-with = ABCD1234
exclude = \.HIDDEN
lru-size = 1024
upload-queue-size = 512

Now just mount:

  • ~/myobnam.conf to /etc/obnam.conf
  • ~/.gnupg to /root/.gnupg

like this:

$ docker run --rm -ti \
  -v /home/tux/Documents:/source:ro \
  -v ~/myobnam.conf:/etc/obnam.conf:ro \
  -v ~/.gnupg:/root/.gnupg:ro \
  maxhq/obnam backup -r sftp://backup.host/backup/destination /source

docker-obnam's People

Contributors

maxhq avatar

Watchers

 avatar  avatar

docker-obnam's Issues

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.