`server-util run --wait` always exited 0 even when the backup finished
with warnings or errors, so scripts and CI could not detect a degraded or
failed backup. Map the parsed backup result to the process exit code,
mirroring the main Duplicati CLI (warnings = 2, errors = 3, fatal = 4),
and propagate a non-zero result from the command handler through to the
process exit code (previously only exceptions set it). Fixes#5870.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This comes from suggestion on issue https://github.com/duplicati/duplicati/issues/6056
The chosen argument was --json which produces a json that wraps the result with extended properties such as in example:
``
{
"Timestamp": "2025-03-28T15:47:01.3368160-03:00",
"UnixTimestamp": 1743187621,
"Command": "import",
"Success": true,
"ExitCode": 0,
"Messages": [
"Importing backup configuration from ../2-firstbacku.json",
"Connecting to http://127.0.0.1:8200/...",
"No database found in../data/",
"Imported \"firstbackup (5)\" with ID 8"
],
"Exceptions": [],
"Imported": {
"Id": "8",
"Name": "firstbackup (5)"
}
}
``
The documentation will reflect all commands and schemas as this makes its way into Canary