nixos/simpcraft: Disable autosave during backup
All checks were successful
CI / Check, build and cache Nix flake (push) Successful in 26m20s

This commit is contained in:
Jack O'Sullivan 2024-01-19 20:06:23 +00:00
parent 0e8aec58fb
commit 977846991a

View File

@ -107,7 +107,11 @@ in
}; };
services = { services = {
borgbackup.jobs.simpcraft = { borgbackup.jobs.simpcraft =
let
rconCommand = cmd: ''${pkgs.mcrcon}/bin/mcrcon -H simpcraft-oci -p "$RCON_PASSWORD" "${cmd}"'';
in
{
paths = [ "/var/lib/containers/storage/volumes/minecraft_data/_data/world" ]; paths = [ "/var/lib/containers/storage/volumes/minecraft_data/_data/world" ];
repo = "/var/lib/containers/backup/simpcraft"; repo = "/var/lib/containers/backup/simpcraft";
doInit = true; doInit = true;
@ -116,9 +120,19 @@ in
# every ~15 minutes offset from 5 minute intervals (Minecraft seems to save at precise times?) # every ~15 minutes offset from 5 minute intervals (Minecraft seems to save at precise times?)
startAt = "*:03,17,33,47"; startAt = "*:03,17,33,47";
prune.keep = { prune.keep = {
within = "1d"; within = "12H";
hourly = 48; hourly = 48;
}; };
# Avoid Minecraft poking the files while we back up
preHook = rconCommand "save-off";
postHook = rconCommand "save-on";
};
};
systemd = {
services = {
borgbackup-job-simpcraft.serviceConfig.EnvironmentFile = [ config.age.secrets."whale2/simpcraft.env".path ];
}; };
}; };