backup: use persistentTimer

This commit is contained in:
Felix Buehler 2022-05-29 18:26:58 +02:00
parent 02e16fa206
commit a4f4996fde

View file

@ -19,16 +19,6 @@ let
unitConfig.OnFailure = "notify-problems@%i.service"; unitConfig.OnFailure = "notify-problems@%i.service";
} }
); );
config.systemd.timers = flip mapAttrs' config.services.borgbackup.jobs (name: value:
nameValuePair "borgbackup-job-${name}" {
# forces backup after boot in case server was powered off during scheduled event
timerConfig.Persistent = true;
# only if network is available
wantedBy = [ "timers.target" ];
after = [ "network-online.target" ];
}
);
}; };
in in
@ -72,6 +62,7 @@ in
compression = "auto,zstd"; compression = "auto,zstd";
doInit = false; doInit = false;
startAt = "daily"; startAt = "daily";
persistentTimer = true;
prune.keep = { prune.keep = {
last = 1; last = 1;
within = "3d"; within = "3d";