Btrbk: Difference between revisions

m Correct which man page to use.
Klinger (talk | contribs)
m Link to btrfs article
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[https://digint.ch/btrbk/ Btrbk], a tool for creating snapshots and remote backups of btrfs subvolumes.
[https://digint.ch/btrbk/ Btrbk], a tool for creating snapshots and remote backups of [[btrfs]] subvolumes.


== Setup ==
== Setup ==
Line 48: Line 48:
</nowiki>}}
</nowiki>}}


The user has to be created on the remote host and needs root permissions on the commands <code>btrfs</code>, <code>readlink</code> and <code>test</code>, for example via [[sudo]]. For transport stream compression using <code>lz4</code> to work, the package must also be installed on the target host. The target host configuration for Btrbk could look like this:
For the remote host, configure SSH access for Btrbk:


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
security.sudo = {
services.btrbk = {
   enable = true;
   sshAccess = [
  extraRules = [{
     {
     commands = [
       key = "ssh-ed25519 blah";
       {
      roles = [
        command = "${pkgs.coreutils-full}/bin/test";
         "target"
        options = [ "NOPASSWD" ];
         "info"
      }
         "receive"
      {
       ];
         command = "${pkgs.coreutils-full}/bin/readlink";
     }
         options = [ "NOPASSWD" ];
   ];
      }
      {
         command = "${pkgs.btrfs-progs}/bin/btrfs";
        options = [ "NOPASSWD" ];
       }
    ];
     users = [ "btrbk" ];
  }];
   extraConfig = with pkgs; ''
    Defaults:picloud secure_path="${lib.makeBinPath [
      btrfs-progs coreutils-full
    ]}:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin"
  '';
};
};
environment.systemPackages = [ pkgs.lz4 ];
</nowiki>}}
</nowiki>}}


==== Local <code>/home</code> Snapshots ====
=== Local <code>/home</code> Snapshots ===
 
{{Warning|This is not a backup solution alone. If the entire disk fails, local snapshots will be lost along with it.}}
{{Warning|This is not a backup solution alone. If the entire disk fails, local snapshots will be lost along with it.}}