Stats grouping by host?

Would it be possible to add a “–group-by” option to stats? The way I’m imagining using it is doing --group-by host --mode raw-data to see how much space each host is taking up. Just a thought. Thanks!

For a given host, you could use restic stats --host <hostname>.

To get the information for all hosts, you somehow have to script the loop over all hosts…

2 Likes

Yeah, that’s what I’m doing currently. I basically run that for each host. I’ve got about 60 hosts though so that takes a minute haha. I was just thinking a “—group-by” could be useful in this scenario.

If this --group-by would be added, some overhead like calling scrypt for the password or reading the index would be done only once. However, in my experience for stats the main computing time goes into the tree traversal (at least for somewhat bigger snapshots). And this would still be needed for each of your snapshot group.

Yeah, it was less about speed and more about not having to type restic stats --host <hostname> for each host. Just a quick --group-by host and it prints out every host automatically. No biggie, just would make it easier is all. :slight_smile: