Computing the size of each snapshot is a very time-consuming process since each tree must be visited to determine how large the snapshot is. Doing this for a list of a hundred snapshots would probably take an hour or so.
Ok, thanks that bit I did not know. Will do with the individual stats then.
I found a solution to find space will be freed if a snapshot were removed.
1- Run restic prune --dry-run
2- Take note of sum ātotal pruneā and āunused size after pruneā
3- Run restic forget snapshotid --prune --dry-run
4- Take note of sum ātotal pruneā and āunused size after pruneā
5- The difference between the sums is the space will be freed if a snapshot were removed.
@fthdgn Thanks for the info!
Should be available easily for all backups made starting with v0.17.0 and later: Store snapshot statistics & print snapshot size by MichaelEischer Ā· Pull Request #4705 Ā· restic/restic Ā· GitHub
Wow thatās great news. Is there a timeline for 0.17 already? So far, I ran these four (time consuming) commands after each backup to gather statistics and store them:
restic stats --json --mode raw-data
restic stats --json --mode raw-data latest
restic stats --json --mode restore-size
restic stats --json --mode restore-size latest
From these some statistics can be derived but the linked pull request provides much more. Thank you!
restic 0.17.0 will still take some time (probably 2 months or more), Iām only halfway through with the planned features.
Iām running 0.17.3
but no size column when i use restic snapshots
What am i doing wrong?
Edit: Restic changelog for 0.17.0:
The
snapshots
command now prints the size for snapshots created using this or a future restic version
That explains it.
@FunctionDJ i guess you updated restic but did not make a new backup. This new feature works fine with 0.17.3, albeit that all backups made with prior versions <17.0 will show no data in the size column as there is no data stored in the repository.
Going back to the original question, one can also achieve snapshot size information (āhow much storage my snapshots are takingā) if you set up metrics monitoring. For example with Prometheus and a Grafana dashboard.
There are various tools who can help with that, including rest-server. Some solutions are already discussed on this forum:
Then you can get something like this example, the npbackup dashboard:
p.s. Also metrics monitoring will not generate/show data for backups made in the past.