Feature Request: Snapshot run time

I’m looking and pushing some data into influx for monitoring backups. And will be using the restic snapshots --json output to do so.

It has the time, but it’d be nice if it had some of this information in the snapshot data:
Added to the repository: 807.399 MiB (807.742 MiB stored)

processed 1154368 files, 201.752 GiB in 35:58

So that I didn’t have to calculate it externally

1 Like

See Print out the backup size when listing snapshots (enhancement) · Issue #693 · restic/restic · GitHub

This is also already implemented in rustic. (the --json option is available in the beta builds and the soon-coming 0.3.1 version)

But afaik it already has (at least some of) this data, no?
You can use --json on backup command too.

Here is an example output:

{"message_type":"summary","files_new":1101,"files_changed":0,"files_unmodified":0,"dirs_new":178,"dirs_changed":0,"dirs_unmodified":0,"data_blobs":1241,"tree_blobs":172,"data_added":252543214,"total_files_processed":1101,"total_bytes_processed":252053522,"total_duration":1.237267003,"snapshot_id":"87d319e0"}

You might need to set RESTIC_PROGRESS_FPS to a different value if you don’t care about progress data though (link)

Using the --json output of restic backup, one can obtain the information, but then the live output in text format is not there. And you have to capture the output of each restic backup in a separate log file and this kind of monitoring can’t be done on the repository alone. This is the reason for

Having this information in the restic snapshots --json output would make such monitoring much easier. Keeping separate log files of backup processes would not be required.

Yeah I’ve got my backups (resticker) writing json files at completion, then will read those in another process. So I’ll only be able to use those as source, no other logs.