More robust gitea dump override

This commit is contained in:
2026-03-05 11:27:45 +01:00
parent 11684d2dc9
commit b34a26a373

View File

@@ -54,9 +54,10 @@
WorkingDirectory = cfg.dump.backupDir;
};
# gitea dump does not allow overriding files. Instead dump to stdout with -
script = ''
${exe} dump --type ${cfg.dump.type} --file - >"gitea-dump-$(date +%a).${cfg.dump.type}"
name="gitea-dump-$(date +%a).${cfg.dump.type}"
${exe} dump --type ${cfg.dump.type} --file - >"$name.tmp"
mv "$name.tmp" "$name"
'';
};