Efficient, deduplicating backup program with optional compression and secure encryption.
inventory.instances = {
borgbackup = {
module = {
name = "borgbackup";
input = "clan-core";
};
roles.client.machines."jon".settings = {
destinations."storagebox" = {
repo = "username@hostname:/./borgbackup";
rsh = ''ssh -oPort=23 -i /run/secrets/vars/borgbackup/borgbackup.ssh'';
};
};
roles.server.machines = { };
};
}; The input should be named according to your flake input. Jon is configured as a client machine with a destination pointing to a Hetzner Storage Box.
This guide explains how to set up and manage BorgBackup for secure, efficient backups in a clan network. BorgBackup provides:
Clients are machines that create and send backups to various destinations. Each client can have multiple backup destinations configured.
Servers act as backup repositories, receiving and storing backups from client machines. They can be dedicated backup servers within your clan network.
This service allows you to perform backups to multiple destinations.
Destinations can be:
server role)For a more comprehensive guide on backups look into the guide section.
The borgbackup service has the following roles:
client roleexternal destinations where the machine should be backuped to
Type: attribute set of (submodule)
Default:
{ } Declared in: clanServices/borgbackup/default.nix
the name of the backup job
Type: string matching the pattern ^[a-zA-Z0-9._-]+$
Default:
"βΉnameβΊ" Declared in: clanServices/borgbackup/default.nix
the borgbackup repository to backup to
Type: string
Declared in: clanServices/borgbackup/default.nix
the rsh to use for the backup
Type: string
Default:
"ssh -i \${config.clan.core.vars.generators.borgbackup.files.\"borgbackup.ssh\".path} -o StrictHostKeyChecking=accept-new" Declared in: clanServices/borgbackup/default.nix
Directories/Files to exclude from the backup. Use * as a wildcard.
Type: list of string
Default:
[ ] [
"*.pyc"
]Declared in: clanServices/borgbackup/default.nix
Type: string
Default:
"*-*-* 01:00:00" Declared in: clanServices/borgbackup/default.nix
server roleAddress to use when connecting to this machine, if null, use
the machines name.
Type: null or string
Default:
null Declared in: clanServices/borgbackup/default.nix
The directory where the borgbackup repositories are stored.
Type: string
Default:
"/var/lib/borgbackup" Declared in: clanServices/borgbackup/default.nix