mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-28 02:40:50 +00:00
nixos/syncoid: catch up missed timer runs (Persistent=true) (#558600)
This commit is contained in:
@@ -362,7 +362,6 @@ in
|
||||
{
|
||||
description = "Syncoid ZFS synchronization from ${c.source} to ${c.target}";
|
||||
after = [ "zfs.target" ];
|
||||
startAt = cfg.interval;
|
||||
# syncoid may need zpool to get feature@extensible_dataset
|
||||
path = [ "/run/booted-system/sw/bin/" ];
|
||||
serviceConfig = {
|
||||
@@ -473,6 +472,23 @@ in
|
||||
]
|
||||
)
|
||||
) cfg.commands;
|
||||
|
||||
systemd.timers = lib.concatMapAttrs (
|
||||
name: c:
|
||||
lib.optionalAttrs
|
||||
(config.systemd.services."syncoid-${escapeUnitName name}".enable && cfg.interval != [ ])
|
||||
{
|
||||
"syncoid-${escapeUnitName name}" = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnCalendar = cfg.interval;
|
||||
# Backup timers should catch up on missed windows (e.g. the
|
||||
# machine was powered off), like restic and btrbk do.
|
||||
Persistent = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
) cfg.commands;
|
||||
};
|
||||
|
||||
meta.maintainers = with lib.maintainers; [
|
||||
|
||||
Reference in New Issue
Block a user