borgback is a Linux software that performs efficient and scheduled backups. It relies on Borg for the backup efficiency. On top of that it adds the following functionalities:
-
use of a configuration file to easily specify the backup repository, exclude folders, etc.
-
schedule backups
-
schedule pruning of old backups
Make sure you have the following dependencies installed:
-
Python >= 3.5
-
borg, on both the host and the remote
-
libnotify (for notify-send)
-
systemd, as borgback relies on it to run as a service
borgback loads its configuration from $XDG_CONFIG_HOME/borgback.toml, this
is usually $HOME/.config/borgback.toml.
A sample configuration file is given in this repository in
samples/borgback.toml.
Edit this file and tailor it to your need (set the backup interval, the remote repository location, etc.)
In order for borgback to start automically at startup:
-
Create the systemd unit file
borgback.service, a sample file is provided atsamples/borgback.service. This file can be placed at$HOME/.config/systemd/user/borgback.serviceEdit this file by setting the correct path to
borgbackon the line starting withExecStart=. -
Enable and start the service with systemd, for example:
systemctl --user enable borgback.service systemctl --user start borgback.service
In order for Borg to automatically delete old backups, you should create another systemd service.
-
Create the
borg-prune.servicefrom theborg-prune.servicesample.Edit this file to set the correct path to Borg, as well as the backup repository and how much backups you want to keep.
-
Enable and start this service
systemctl --user enable borg-prune.service systemctl --user start borg-prune.service
-
Create the
borg-prune.timerfrom theborg-prune.timersample.Edit this file to set when to check for backup pruning.
-
Enable the timer
systemctl --user enable borg-prune.timer