mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-05-24 18:04:41 +02:00
backup: replace ping to google with systemd-network-online.target
This commit is contained in:
parent
2113718891
commit
6fde591af6
1 changed files with 4 additions and 5 deletions
|
@ -17,17 +17,16 @@ let
|
||||||
} // flip mapAttrs' config.services.borgbackup.jobs (name: value:
|
} // flip mapAttrs' config.services.borgbackup.jobs (name: value:
|
||||||
nameValuePair "borgbackup-job-${name}" {
|
nameValuePair "borgbackup-job-${name}" {
|
||||||
unitConfig.OnFailure = "notify-problems@%i.service";
|
unitConfig.OnFailure = "notify-problems@%i.service";
|
||||||
preStart = lib.mkBefore ''
|
|
||||||
# waiting for internet after resume-from-suspend
|
|
||||||
until /run/wrappers/bin/ping google.com -c1 -q >/dev/null; do :; done
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
# forces backup after boot in case server was powered off during scheduled event
|
|
||||||
config.systemd.timers = flip mapAttrs' config.services.borgbackup.jobs (name: value:
|
config.systemd.timers = flip mapAttrs' config.services.borgbackup.jobs (name: value:
|
||||||
nameValuePair "borgbackup-job-${name}" {
|
nameValuePair "borgbackup-job-${name}" {
|
||||||
|
# forces backup after boot in case server was powered off during scheduled event
|
||||||
timerConfig.Persistent = true;
|
timerConfig.Persistent = true;
|
||||||
|
# only if network is available
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
|
after = [ "network-online.target" ];
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue