Sign inSign up

valmati/borgclient

By valmati

•Updated over 2 years ago

Image with a SSH client and BorgBackup installed and ready to use as a backup client over SSH.

Image
0

4.7K

valmati/borgclient repository overview

⁠BORG CLIENT

.github/workflows/docker-publish.yml

Docker image with a SSH client and BorgBackup installed and ready to use as a backup client over SSH.

The idea of this image is to be used on computers that are not always on (laptops or desktop workstations), so the backup is scheduled for 5 minutes after the container starts.

⁠Source Code & Image

The code is available on GitHub⁠

With each release a new version of the image is published on DockerHub⁠

⁠Usage

It is recommended to launch the image from a docker-compose as in the example⁠.

As usual, it is necessary to indicate the image, in this case valmati/borgclient:latest⁠.

The following is a description of each of the fields to be given a value in the docker-compose.

⁠Hostname

It's important set the hostname because the host keys have information about this.

⁠Environment

The following are the environment variables to be defined:

VariableDescriptionValue
TZTime ZoneEurope/Madrid
BORG_SERVERIP or domain of the server on which the backups will be made192.168.1.200
PREFIXPrefix with which the files in the backup will be createdClientPrefix
BOT_TOKENToken of the bot through which we will receive Telegram notifications.123:ABC
CHAT_IDIdentifier of the user or group that will receive Telegram notifications.-123
PASSPHRASERepository backup passphrasepassphrase
REPO_PATHPath of the repository inside the server. This path can be relative or absolute. It should be noted that on the server access may be restricted by --restrict-to-path./
KEEP_HOURLY*4
KEEP_DAILY*7
KEEP_WEEKLY*4
KEEP_MONTHLY*6
FREQUENCYBackup frequency. With values 1, 2, 3, 4, 6, 8 or 12 the backups runs with this frequency. With any other value once a day.1

* see BorgBackup documentation⁠ about prune and de KEEP_* flags

⁠Volumes

The borgclient container must have access to three volumes:

⁠SSH Keys (/root/.ssh/)

In this volume there are two things:

  • The customer SSH keys, if they do not exist they will be created.

  • A known_hosts file with the server key. If they do not exist we can try to start from the container a connection with the server and then we will be asked to accept the key, in which case the file will be created.

⁠Log (/log/)

The volume where the container generates the logs.

⁠Borg Config (/borgconfig/)

In this volume the container look for a file exclude.txt, a file with exclude patterns from EXCLUDEFILE, one per line.

⁠Backup (/backup/)

This volume is the source to backup.

⁠Init

If the report doesn't exists you need to initialize a new one. To do this execute:

docker exec -it borgclient1 /bin/borg_backup.sh

Borg will ask you for a passphrase, enter it and that's it.

⁠Inspired on

(https://github.com/MrCaringi/Backups-and-Replication/)[https://github.com/MrCaringi/Backups-and-Replication/⁠]

Tag summary

Content type

Image

Digest

sha256:bb9717ba3…

Size

31.5 MB

Last updated

over 2 years ago

docker pull valmati/borgclient