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