btrfsborg: compression, rm timelapse from rsync.net

This commit is contained in:
2025-03-15 19:41:36 +00:00
parent fce3ea08ef
commit 4059674d35
3 changed files with 75 additions and 47 deletions

View File

@@ -573,21 +573,31 @@ in
}; };
}; };
btrfsborg = { btrfsborg =
enable = true; let
passwordPath = config.age.secrets.borgbackup-password.path; this = "${config.networking.hostName}.${config.networking.domain}";
sshKeyPath = "/etc/ssh/ssh_host_ed25519_key"; vno3-nk = "borgstor@${myData.hosts."vno3-nk.jakst.vpn".jakstIP}";
dirs = rsync-net = "zh2769@zh2769.rsync.net";
builtins.concatMap in
( {
host: enable = true;
let passwordPath = config.age.secrets.borgbackup-password.path;
prefix = "${host}:${config.networking.hostName}.${config.networking.domain}"; sshKeyPath = "/etc/ssh/ssh_host_ed25519_key";
in dirs =
[ [
{
subvolume = "/var/lib";
repo = "${vno3-nk}:${this}-timelapse-r11";
paths = [ "private/timelapse-r11" ];
backup_at = "*-*-* 02:01:00 UTC";
compression = "none";
}
]
++ (builtins.concatMap
(host: [
{ {
subvolume = "/var/lib"; subvolume = "/var/lib";
repo = "${prefix}-var_lib"; repo = "${host}:${this}-var_lib";
paths = [ paths = [
"hass" "hass"
"gitea" "gitea"
@@ -597,7 +607,6 @@ in
"bitwarden_rs" "bitwarden_rs"
"matrix-synapse" "matrix-synapse"
"private/soju" "private/soju"
"private/timelapse-r11"
# https://immich.app/docs/administration/backup-and-restore/ # https://immich.app/docs/administration/backup-and-restore/
"immich/library" "immich/library"
@@ -610,17 +619,17 @@ in
} }
{ {
subvolume = "/home"; subvolume = "/home";
repo = "${prefix}-home-motiejus-annex2"; repo = "${host}:${this}-home-motiejus-annex2";
paths = [ "motiejus/annex2" ]; paths = [ "motiejus/annex2" ];
backup_at = "*-*-* 02:30:01 UTC"; backup_at = "*-*-* 02:30:01 UTC";
} }
])
[
rsync-net
vno3-nk
] ]
) );
[ };
"zh2769@zh2769.rsync.net"
"borgstor@${myData.hosts."vno3-nk.jakst.vpn".jakstIP}"
];
};
btrfssnapshot = { btrfssnapshot = {
enable = true; enable = true;

View File

@@ -125,31 +125,47 @@ in
verboseLogs = false; verboseLogs = false;
}; };
btrfsborg = { btrfsborg =
enable = true; let
passwordPath = config.age.secrets.borgbackup-password.path; this = "${config.networking.hostName}.${config.networking.domain}";
sshKeyPath = "/etc/ssh/ssh_host_ed25519_key"; rsync-net = "zh2769@zh2769.rsync.net";
dirs = fwminex = "borgstor@${myData.hosts."fwminex.jakst.vpn".jakstIP}";
builtins.concatMap in
( {
host: enable = true;
let passwordPath = config.age.secrets.borgbackup-password.path;
prefix = "${host}:${config.networking.hostName}.${config.networking.domain}"; sshKeyPath = "/etc/ssh/ssh_host_ed25519_key";
in dirs =
#[
#{
# subvolume = "/data";
# repo = "${fwminex}:${this}-timelapse-r11";
# paths = [ "timelapse-r11" ];
# backup_at = "*-*-* 02:01:00 UTC";
# compression = "none";
#}
#] ++ (
builtins.concatMap
(
host:
let
prefix = "${host}:${this}";
in
[
{
subvolume = "/data";
repo = "${prefix}-data";
paths = [ "vno3-shared" ];
backup_at = "*-*-* 01:00:01 UTC";
}
]
)
[ [
{ rsync-net
subvolume = "/data"; fwminex
repo = "${prefix}-data"; ];
paths = [ "vno3-shared" ]; #);
backup_at = "*-*-* 01:00:01 UTC"; };
}
]
)
[
"zh2769@zh2769.rsync.net"
"borgstor@${myData.hosts."fwminex.jakst.vpn".jakstIP}"
];
};
btrfssnapshot = { btrfssnapshot = {
enable = true; enable = true;

View File

@@ -33,6 +33,10 @@ in
default = { }; default = { };
}; };
backup_at = lib.mkOption { type = str; }; backup_at = lib.mkOption { type = str; };
compression = lib.mkOption {
type = str;
default = "auto,zstd,10";
};
}; };
}); });
}; };
@@ -59,7 +63,7 @@ in
"config.mj.base.unitstatus.enable must be true"; "config.mj.base.unitstatus.enable must be true";
lib.nameValuePair "${lib.strings.sanitizeDerivationName subvolume}-${toString i}" ( lib.nameValuePair "${lib.strings.sanitizeDerivationName subvolume}-${toString i}" (
{ {
inherit (attrs) repo paths; inherit (attrs) repo paths compression;
doInit = true; doInit = true;
encryption = { encryption = {
@@ -67,7 +71,6 @@ in
passCommand = "cat ${cfg.passwordPath}"; passCommand = "cat ${cfg.passwordPath}";
}; };
extraArgs = "--remote-path=borg1"; extraArgs = "--remote-path=borg1";
compression = "auto,zstd,10";
extraCreateArgs = "--chunker-params buzhash,10,23,16,4095"; extraCreateArgs = "--chunker-params buzhash,10,23,16,4095";
startAt = attrs.backup_at; startAt = attrs.backup_at;
preHook = '' preHook = ''