Your question
Hi,
we use Vandelay to back up Stalwart mailboxes on a schedule. For each account we run vandelay import jmap into a SQLite archive, and restic then snapshots the archives. It works well, and we’re now building a small web UI around it to manage several Stalwart instances.
The documented exit codes help a lot. Beyond that, though, the only way to see what happened per account is to parse the text log, and that breaks easily when the wording changes.
Would you consider an option for machine-readable output as you already do for stalwart-cli? Something like --json, writing one JSON object per line to stdout or a file. Rough idea, the exact fields are up to you:
{"event":"progress","account":"[email protected]","type":"email","done":1200,"total":5400}
{"event":"warning","account":"[email protected]","type":"email","id":"...","message":"..."}
{"event":"done","account":"[email protected]","added":12,"updated":3,"deleted":1,"failed":0,"duration_ms":8423,"exit_code":0}
What would help us most:
a final summary per run with counts per object type and failures
warnings and partial failures (exit code 5) with the affected object
ideally the archive schema version, so tools that read the SQLite file read-only can check compatibility
Thanks for Vandelay, it made our Stalwart backups much simpler.
I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.
on
Based on the current docs, Vandelay does not have a --json or machine-readable output option today. The documented controls for scripting are the exit codes and the -v/-q verbosity flags: by default it prints per-type progress and a final summary to stdout, with deeper -v/-vv/-vvv detail (including retries and full protocol traffic) sent to stderr so stdout “stays parseable,” but there’s no structured NDJSON event stream like stalwart-cli’s --json.
What exists right now for scripted backups:
- Exit codes distinguish success (0), usage/connection/account/archive failures (1-4, 7), and partial per-object failures (5), so a wrapper script can at least branch on overall outcome.
vandelay inspect <archive> gives a read-only per-type summary (and per-object listing) of an archive’s contents, which could substitute for some of what a JSON summary would provide, though it’s human-formatted text, not JSON, and doesn’t expose a schema version.
So the --json/per-account event stream, per-warning object identification, and archive schema version you’re asking for aren’t available in the current tool. This looks like a solid feature request rather than something documented, so I’ll leave it for the team to pick up.
Reference: Usage | Stalwart
This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.
Today the exit code is the only structured signal Vandelay gives a script (5 means a partial run). JSON lines for progress, warnings and a final summary with per-type counts would be useful, and I’ve added it to the list, together with a schema version in the archive, which it doesn’t record yet.
The archive is plain SQLite, so per-type counts after a run are a query away, e.g. SELECT data_type, COUNT(*) FROM calendar_events GROUP BY data_type. That also shows the tasks and journals from your other topic, which are archived but not exported, so keep them in mind if you ever restore from these backups.