backups for mine

This commit is contained in:
2026-11-17 15:50:34 +00:00
parent 7eca6452bb
commit 8d846892d5
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ let
exit 1
fi
fi
${pkgs.rsync}/bin/rsync -a --delete --delete-excluded \
${pkgs.rsync}/bin/rsync -a --checksum --delete --delete-excluded \
${lib.concatMapStringsSep " \\\n " (path: "--exclude=${lib.escapeShellArg "/${path}"}") server.exclude} \
${lib.escapeShellArg "${server.directory}/"} "$staging_dir/"
${restore name server}
+5 -1
View File
@@ -126,6 +126,10 @@ in {
assert cfg.systemd.timers.minecraft-backup-auto.timerConfig.OnCalendar == "*-*-* 00/6:00:00";
pkgs.runCommand "minecraft-backup-enabled-server-timers" {} ''touch "$out"'';
minecraft-backup-upload-and-retention = runCase "upload-and-retention" ''
# A warm staging copy can have stale bytes despite identical size and mtime.
mkdir -p /build/backups/test/staging/world
printf 'stale-data\n' > /build/backups/test/staging/world/level.dat
touch -r /build/source/world/level.dat /build/backups/test/staging/world/level.dat
${service.serviceConfig.ExecStart}
test "$(cat /build/control/state)" = active
test ! -e /build/backups/test/restart-needed
@@ -136,7 +140,7 @@ in {
test -z "$(find /build/backups/test/archive -name '*.tar.zst' -print)"
mkdir /build/restored
tar --zstd -xf /build/bucket/minecraft-test-20231114T221320Z.tar.zst -C /build/restored
test "$(cat /build/restored/world/level.dat)" = world-data
cmp /build/source/world/level.dat /build/restored/world/level.dat
test ! -e /build/restored/server.properties
'';
minecraft-backup-copy-failure-resumes-server = runCase "copy-failure-resumes-server" ''