From 5d9e3164e44593932879e5ced0b693bfbbc4eb9c Mon Sep 17 00:00:00 2001 From: Jaculabilis Date: Sun, 27 Nov 2022 00:04:40 +0000 Subject: [PATCH] Re-enable cron and inline perm script --- configuration.nix | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/configuration.nix b/configuration.nix index bd1464d..3b9f270 100644 --- a/configuration.nix +++ b/configuration.nix @@ -55,13 +55,20 @@ }; }; - #services.cron = { - # enable = true; - # systemCronJobs = [ - # "0 20 * * 1 root /root/reassert-nas-permissions.sh" - # "0 0 * * 1 tvb . /etc/profile; /home/tvb/gitea-backup" - # ]; - #}; + services.cron = { + enable = true; + systemCronJobs = + let + reassertPerms = pkgs.writeShellScript "reassert-nas-permissions.sh" '' + ${pkgs.coreutils}/bin/chown -v -R tvb:nas /nas + ${pkgs.findutils}/bin/find /nas -type d -exec ${pkgs.coreutils}/bin/chmod -v 750 {} \; + ${pkgs.findutils}/bin/find /nas -type f -exec ${pkgs.coreutils}/bin/chmod -v 640 {} \; + ''; + in [ + "0 20 * * 1 root ${reassertPerms}" + "0 0 * * 1 tvb . /etc/profile; /home/tvb/gitea-backup" + ]; + }; services.openssh = { enable = true;