Add a service to check the repository

This commit is contained in:
Andreas Zweili 2022-11-21 08:36:21 +01:00
parent e58962c677
commit 0cd35f1bba
1 changed files with 19 additions and 0 deletions

View File

@ -46,6 +46,25 @@ in
systemd.timers.restic-prune = {
wantedBy = [ "timers.target" ];
partOf = [ "restic-prune.service" ];
timerConfig.OnCalendar = [ "*-*-* 08:00:00" ];
};
systemd.services.restic-check = {
serviceConfig = {
Type = "oneshot";
User = "restic";
};
onFailure = [ "unit-status-telegram@%n.service" ];
script = ''
${pkgs.restic}/bin/restic \
--repo ${repository} \
--password-file ${config.age.secrets.resticKey.path} \
check \
'';
};
systemd.timers.restic-prune = {
wantedBy = [ "timers.target" ];
partOf = [ "restic-check.service" ];
timerConfig.OnCalendar = [ "*-*-* 07:00:00" ];
};
}