feat: more btrbk things

feat/kile-v2
Ricard Illa 2023-04-26 11:30:08 +02:00
parent 8eb37952f4
commit e7b0d0ba53
No known key found for this signature in database
GPG Key ID: F69A672B72E54902
1 changed files with 28 additions and 8 deletions

View File

@ -6,7 +6,7 @@
let
home = "/home/rilla";
run-offline-backups = pkgs.writeScriptBin "run-offline-backups" ''
offline-backups = pkgs.writeScriptBin "offline-backups" ''
#!${pkgs.dash}/bin/dash
set -xe
@ -16,10 +16,10 @@ let
done && \
/run/wrappers/bin/doas -u btrbk \
${pkgs.btrbk}/bin/btrbk \
-c /etc/btrbk/offline-backups.conf \
--config /etc/btrbk/offline-backups.conf \
--progress \
--verbose \
run
"$@"
'';
in {
@ -163,7 +163,7 @@ in {
# services.thermald.enable = true;
services.tlp.enable = true;
services.power-profiles-daemon.enable = false;
environment.systemPackages = with pkgs; [ powertop acpi run-offline-backups ];
environment.systemPackages = with pkgs; [ powertop acpi offline-backups ];
#services.beesd.filesystems = {
# root = {
@ -199,10 +199,15 @@ in {
ssh_user = "btrbk";
ssh_identity = "/etc/btrbk/id_ed25519";
backend_remote = "btrfs-progs-doas";
snapshot_create = "onchange";
snapshot_preserve_min = "latest";
target_preserve_min = "all";
volume = {
"ssh://narwhal:22/mnt/btr_pool" = {
snapshot_dir = "btrbk_snapshots";
stream_buffer = "50%";
stream_compress = "zstd";
snapshot_dir = "btrbk_snapshots_offline";
subvolume = {
backups = { };
books = { };
@ -225,14 +230,14 @@ in {
};
"ssh://suricata:22/mnt/btr_pool" = {
snapshot_dir = "btrbk_snapshots";
stream_buffer = "50%";
snapshot_dir = "btrbk_snapshots_offline";
compat_remote = "busybox";
subvolume = {
home = { };
rancher_config = { };
backups = { };
configs = { };
};
target = {
"/mnt/backups/0/btr_backup/suricata" = { };
@ -240,8 +245,23 @@ in {
"/mnt/backups/2/btr_backup/suricata" = { };
};
};
};
"ssh://10.8.8.2:22/mnt/btr_pool" = {
stream_buffer = "50%";
snapshot_dir = "btrbk_snapshots_offline";
compat_remote = "busybox";
subvolume = {
certs = { };
volumes = { };
};
target = {
"/mnt/backups/0/btr_backup/caladan" = { };
"/mnt/backups/1/btr_backup/caladan" = { };
"/mnt/backups/2/btr_backup/caladan" = { };
};
};
};
};
};
};