Update backup policy

This commit is contained in:
Sicheng Pan 2025-08-09 13:57:06 -05:00
parent e938eb26a8
commit 1a46a65c00
Signed by: macronova
GPG key ID: CE969670FB4B4A56

View file

@ -31,7 +31,7 @@
jobs = let jobs = let
archiveBaseName = "archive"; archiveBaseName = "archive";
backupBaseName = "backup"; backupBaseName = "backup";
pushConfig = name: grid: { pushConfig = name: snapshot: grid: {
type = "push"; type = "push";
name = "push-${name}"; name = "push-${name}";
connect = { connect = {
@ -41,12 +41,13 @@
}; };
filesystems."zactive/main/home" = true; filesystems."zactive/main/home" = true;
send.encrypted = true; send.encrypted = true;
snapshotting.type = "manual"; snapshotting = snapshot;
pruning = { pruning = {
keep_sender = [ keep_sender = [
{ {
type = "regex"; type = "grid";
regex = "^zrepl-.*"; regex = "^zrepl-.*";
grid = lib.concatStringsSep " | " ["1x1h(keep=all)" "24x1h" "7x1d" "4x1w"];
} }
]; ];
keep_receiver = [ keep_receiver = [
@ -73,27 +74,12 @@
recv.placeholder.encryption = "off"; recv.placeholder.encryption = "off";
}; };
in [ in [
{ (pushConfig archiveBaseName {
type = "snap"; type = "periodic";
name = "snapshot"; prefix = "zrepl-";
filesystems."zactive/main/home" = true; interval = "1h";
snapshotting = { } ["1x1h(keep=all)" "30x1d" "52x1w"])
type = "periodic"; (pushConfig backupBaseName {type = "manual";} ["8x13w"])
prefix = "zrepl-";
interval = "1h";
};
pruning = {
keep = [
{
type = "grid";
regex = "^zrepl-.*";
grid = lib.concatStringsSep " | " ["1x1h(keep=all)" "24x1h" "7x1d" "4x1w"];
}
];
};
}
(pushConfig archiveBaseName ["1x1h(keep=all)" "30x1d" "52x1w"])
(pushConfig backupBaseName ["8x13w"])
(sinkConfig archiveBaseName "zarchive/snapshot") (sinkConfig archiveBaseName "zarchive/snapshot")
(sinkConfig backupBaseName "zbackup/snapshot") (sinkConfig backupBaseName "zbackup/snapshot")
]; ];