mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-05-24 18:04:41 +02:00
backup: use persistentTimer
This commit is contained in:
parent
02e16fa206
commit
a4f4996fde
1 changed files with 1 additions and 10 deletions
11
backup.nix
11
backup.nix
|
@ -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";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue