Actually, there is a way. Here is how to see the collective usage of the first 4 snapshots:
$ SNAPSHOTS=$(restic -r /repo -p /pass snapshots --json | \
jq -r '.[].short_id' | head -n 4)
$ restic -r /repo -p /pass stats --json --mode=files-by-contents $SNAPSHOTS
{"total_size":3548103559,"total_file_count":6410,"snapshots_count":4}
And then do that for the first snapshot, the first two, the first three, etc. This is not the fastest approach, but should be accurate:
O( nSnapshots^2 * snapshotSize)
If restic stats
had an option to print out the cumulative size after each snapshot, that would eliminate having to do it muliple times, and reduce that to:
O( nSnapshots * snapshotSize)