From 89e0f6827565150d726d2b3288709b6831322b74 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Wed, 11 Dec 2024 14:02:34 -0500 Subject: [PATCH] backups --- hosts/hl-bigbox1.nix | 20 ++++++++++++++++++++ hosts/hl-fws1.nix | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/hosts/hl-bigbox1.nix b/hosts/hl-bigbox1.nix index c6d14bf..f6cbcab 100644 --- a/hosts/hl-bigbox1.nix +++ b/hosts/hl-bigbox1.nix @@ -44,4 +44,24 @@ jellyfin-web jellyfin-ffmpeg ]; + + systemd.timers."backup-jellyfin" = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "daily"; + Persistent = true; + Unit = "backup-jellyfin.service"; + }; + }; + + systemd.services."backup-jellyfin" = { + script = '' + set -eu + ${pkgs.rsync}/bin/rsync -avpzP --delete /opt/jellyfin /mnt/terra1/Data/apps/ + ''; + serviceConfig = { + Type = "oneshot"; + User = "root"; + }; + }; } diff --git a/hosts/hl-fws1.nix b/hosts/hl-fws1.nix index 77dd625..219a008 100644 --- a/hosts/hl-fws1.nix +++ b/hosts/hl-fws1.nix @@ -1,6 +1,6 @@ { user }: { pkgs, lib, config, ... }: { - imports = [ ./hl-minipc1.hardware-configuration.nix ]; + imports = [ ./hl-fws1.hardware-configuration.nix ]; skyg.user.enable = true; skyg.nixos.common.ssh-server.enable = true; skyg.server.admin.enable = true;