I would like to log what happened during a backup or forget command, in particular when run automatically via systemd. But also for a manual run, because it then behaves the same no matter if I start it or systemd. To this end, I use these options (simplified):
would then show the normal command line output but write the json output to the given file.
As long as this is not implemented, can I retrieve the same information that --json writes also from a restic diff output without creating log files during backup?
Is there a way to get both json and plain text output simultaneously
Would that be a reasonable feature request?
Can I get the same information from restic diff or any other command?
The suggested --log-file feature is hardly a priority at this point, and I can’t recall anyone else asking for it either so it doesn’t seem like a pressing need. And if it were to exist, it would then have to be established how one is supposed to configure that the log file is supposed to be JSON and not plain text, while at the same time one wants either of those on the standard output. I just don’t see this being something worth considering right now, honestly.
An even better solution would be to have the backup metadata (like added size, backup duration) already to the snapshot as asked for in the forum thread below. Then json log files would not be necessary.
Thanks, I know tee. That’s not the point. If I do a manual backup, I like the updating progress where I can see which files are currently processed. But I want to know the backup duration etc. which is provided only by the backup command and afaik not in the snapshot metadata.
Now, I have to do this tee thing to logfiles (and not just restic backup) and if I want to see the files flying by, I have to parse the text output instead of using --json and a json parser. For backup monitoring it would be much easier if the summary data (duration, data added) was stored with the snapshots.