More robust gitea dump override
All checks were successful
CI / build:all (pull_request) Successful in 22m52s
CI / build:cross (pull_request) Successful in 31m45s

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

View File

@@ -54,9 +54,19 @@
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}"
output="gitea-dump-$(date +%a).${cfg.dump.type}"
if ${exe} dump --type ${cfg.dump.type} --file - >"temp.zip" ; then
if [ -s "temp.zip" ] ; then
mv temp.zip "$output"
echo "INFO: Backup saved at $output"
exit 0
fi
echo "ERROR: dump command exited correctly, but temp.zip is empty"
fi
echo "ERROR: dump failed"
exit 1
'';
};