From 24efea29a8e6e643a6e1fcc77a21e23c8ffe2684 Mon Sep 17 00:00:00 2001 From: Ethan Simmons Date: Mon, 21 Oct 2024 16:46:46 -0500 Subject: [PATCH] Add minecraft server backup --- .../{mc-arcadia-backup.yaml => mc-dh-backup.yaml} | 0 hosts/diphda/system.nix | 11 ++++++----- 2 files changed, 6 insertions(+), 5 deletions(-) rename hosts/diphda/{mc-arcadia-backup.yaml => mc-dh-backup.yaml} (100%) diff --git a/hosts/diphda/mc-arcadia-backup.yaml b/hosts/diphda/mc-dh-backup.yaml similarity index 100% rename from hosts/diphda/mc-arcadia-backup.yaml rename to hosts/diphda/mc-dh-backup.yaml diff --git a/hosts/diphda/system.nix b/hosts/diphda/system.nix index 4bcad4c..d529295 100644 --- a/hosts/diphda/system.nix +++ b/hosts/diphda/system.nix @@ -21,6 +21,7 @@ age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; secrets."mc-arcadia/repo_password" = {}; + secrets."mc-dh/repo_password" = {}; secrets."tandoor/secret_key" = { owner = "tandoor"; }; @@ -38,7 +39,7 @@ }; }; - systemd.timers."mc-arcadia-backup" = { + systemd.timers."mc-dh-backup" = { wantedBy = [ "timers.target" ]; timerConfig = { OnCalendar = "*-*-* *:00:00"; @@ -46,14 +47,14 @@ }; }; - systemd.services."mc-arcadia-backup" = { + systemd.services."mc-dh-backup" = { enable = true; preStart = '' - ${pkgs.docker}/bin/docker exec mc-arcadia-mc-1 mc-send-to-console say Server backup starting in 5 minutes + ${pkgs.docker}/bin/docker exec mc-distant-horizons-mc-1 mc-send-to-console say Server backup starting in 5 minutes sleep 5m ''; postStart = '' - ${pkgs.docker}/bin/docker exec mc-arcadia-mc-1 mc-send-to-console say Server backup starting + ${pkgs.docker}/bin/docker exec mc-distant-horizons-mc-1 mc-send-to-console say Server backup starting ''; serviceConfig = { Type = "oneshot"; @@ -61,7 +62,7 @@ ExecStart = '' systemd-inhibit --who="borgmatic" \ --why="Prevent interrupting scheduled backup" \ - ${pkgs.borgmatic}/bin/borgmatic -c /etc/nixos/hosts/diphda/mc-arcadia-backup.yaml --verbosity 1 --syslog-verbosity 1 + ${pkgs.borgmatic}/bin/borgmatic -c /etc/nixos/hosts/diphda/mc-dh-backup.yaml --verbosity 1 --syslog-verbosity 1 ''; }; };