intelliops/backintime

By intelliops

Updated about 6 years ago

Docker image to run backups using backintime and SSH

Image
0

168

docker-backintime

Build statusBuild status

Docker container to perform backups using backintime (oriented towards SSH backup mode)

Supported tags

latest

Latest version of backintime (installed from source).

wake-on-lan

Same as latest, but with the additional feature of powering on the backup target with WOL and shutting it down again after the backup. For shutting down the backup target, please have a look at the bottom of this file so see how you have to configure sudoers for the backup target.

Usage

Install

docker pull intelliops/backintime:latest

Running

docker run -ti --name backintime \
  -v /home/<USER>/.ssh/id_rsa:/root/.ssh/id_rsa:ro \
  -v /home:/host/home:ro \
  -v /etc:/host/etc:ro \
  -v /root:/host/root:ro \
  -v /usr:/host/usr:ro \
  --net=host \
  --privileged \
  intelliops/backintime:latest
docker run -ti --name backintime \
  -e MAC=aa:bb:cc:00:11:22 \
  -e INTF=eth0 \
  -v /home/<USER>/.ssh/id_rsa:/root/.ssh/id_rsa:ro \
  -v /home:/host/home:ro \
  -v /etc:/host/etc:ro \
  -v /root:/host/root:ro \
  -v /usr:/host/usr:ro \
  --net=host \
  --privileged \
  intelliops/backintime:wake-on-lan

TODO: remove privileged flag and specify only needed capabilities:

  --cap-add=NET_ADMIN \
  --cap-add=NET_BROADCAST \
  --cap-add=NET_RAW \
  --cap-add=SYS_RESOURCE \
  --cap-add=SYS_ADMIN --device /dev/fuse

The backup process will start immediately after starting the container.

Volumes

PathDescription
/root/.ssh/id_rsaSSH key to login to the backup target
/etc/backintime/configConfiguration of backintime
/host/<FOLDER_TO_BACKUP>Directories that need to be included in the backup

Configuration

Environmental variables

Only relevant for wake-on-lan version of the Docker image.

Environmental variableDescription
MACThe MAC address of the backup target that will be awakened by WOL
INTFThe network interface of the host performing the backup, where the backup target can be found on
Custom configuration file

To run the backup, you will have to mount the backintime configuration file into the Docker container. An example can be found back in backintime.example.

Backup target sudoers

The backup target is shutdown after a successful backup. For performing the shutdown command, super user permissions are needed. Which means that the following entry has to be added in /etc/sudoers to make this work.

<USER> ALL=NOPASSWD: /sbin/shutdown

Reference

https://github.com/bit-team/backintime

Docker Pull Command

docker pull intelliops/backintime