add a prune timer to the backup server
This commit is contained in:
parent
d65f4dcb31
commit
47c794b59e
|
@ -17,4 +17,25 @@ in
|
||||||
extraFlags = [ "--no-auth" ];
|
extraFlags = [ "--no-auth" ];
|
||||||
};
|
};
|
||||||
networking.firewall.allowedTCPPorts = [ 8000 ];
|
networking.firewall.allowedTCPPorts = [ 8000 ];
|
||||||
|
|
||||||
|
systemd.services.prune-restic = {
|
||||||
|
serviceConfig.Type = "oneshot";
|
||||||
|
script = ''
|
||||||
|
${pkgs.restic}/bin/restic \
|
||||||
|
--repo ${repository} \
|
||||||
|
--password-file "/home/${custom.username}/.nixos/secrets/passwords/restic.key" \
|
||||||
|
forget \
|
||||||
|
--keep-daily 7 \
|
||||||
|
--keep-weekly 5 \
|
||||||
|
--keep-monthly 12 \
|
||||||
|
--keep-yearly 75 \
|
||||||
|
--prune
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.timers.prune-restic = {
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
|
partOf = [ "prune-restic.service" ];
|
||||||
|
timerConfig.OnCalendar = [ "*-*-* 12:00:00" ];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user