diff --git a/common/nfs-services-standby.nix b/common/nfs-services-standby.nix index f241a7a..6a9894c 100644 --- a/common/nfs-services-standby.nix +++ b/common/nfs-services-standby.nix @@ -39,15 +39,15 @@ in noCheck = true; }; - # Cleanup old snapshots on standby (keep last 48 hours for safety) + # Cleanup old snapshots on standby (keep last 4 hours for HA failover) systemd.services.cleanup-services-standby-snapshots = { description = "Cleanup old btrfs snapshots in services-standby"; path = [ pkgs.btrfs-progs pkgs.findutils ]; script = '' set -euo pipefail - # Keep last 48 hours of snapshots (576 snapshots at 5min intervals) - find /persist/services-standby -maxdepth 1 -name 'services@*' -mmin +2880 -exec btrfs subvolume delete {} \; || true + # Keep last 4 hours of snapshots (48 snapshots at 5min intervals) + find /persist/services-standby -maxdepth 1 -name 'services@*' -mmin +240 -exec btrfs subvolume delete {} \; || true ''; serviceConfig = {