Add a service to check the repository
This commit is contained in:
parent
e58962c677
commit
0cd35f1bba
|
@ -46,6 +46,25 @@ in
|
||||||
systemd.timers.restic-prune = {
|
systemd.timers.restic-prune = {
|
||||||
wantedBy = [ "timers.target" ];
|
wantedBy = [ "timers.target" ];
|
||||||
partOf = [ "restic-prune.service" ];
|
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" ];
|
timerConfig.OnCalendar = [ "*-*-* 07:00:00" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue