From 0f0280473fa69e97579f86503b31f73479295464 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 23 Mar 2024 03:43:52 -0600 Subject: [PATCH] Added pixel image backup systemd timer --- shared/server-configuration.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/shared/server-configuration.nix b/shared/server-configuration.nix index 9107302..3bb513b 100644 --- a/shared/server-configuration.nix +++ b/shared/server-configuration.nix @@ -146,6 +146,25 @@ in # }; # }; }; + + systemd.timers."pixel-backups" = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "daily"; + }; + }; + + systemd.services."pixel-backups" = { + script = '' + # Move files older than 90 days to the backups file + find /nfs_export/kage/syncthing/pixel_images/ -type f -mtime +90 | xargs -I {} mv {} /nfs_export/kage/Personal_Media/Nate/ + ''; + serviceConfig = { + Type = "oneshot"; + User = "root"; + }; + }; + # networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ];