Btrbk

From NixOS Wiki
Revision as of 11:52, 4 February 2023 by imported>Onny

Btrbk, a tool for creating snapshots and remote backups of btrfs subvolumes.

Configuration

Following example configuration will create a weekly incremental backup of a local Btrfs subvolume called nixos and sends it compressed to a remote host myhost via ssh using provided authentication credentials.

services.btrbk = {
  extraPackages = [ pkgs.lz4 ];
  instances.remote = {
    onCalendar = "weekly";
    settings = {
      ssh_identity = "/etc/btrbk_key";
      ssh_user = "btrbk";
      stream_compress = "lz4";
      volume."ssh://myhost/mnt" = {
        target = "/mnt";
        subvolume = "nixos";
      };
    };
  };
};