Skip to content

Show progress for restic stats#5705

Merged
MichaelEischer merged 4 commits into
restic:masterfrom
Paulomen2712:stats-progress
May 15, 2026
Merged

Show progress for restic stats#5705
MichaelEischer merged 4 commits into
restic:masterfrom
Paulomen2712:stats-progress

Conversation

@Paulomen2712

@Paulomen2712 Paulomen2712 commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

What does this PR change? What problem does it solve?

restic stats now displays progress for how many snapshots, files, and blobs were processed so far.
This lets users better understand if the command is working as expected or where it is hanging.

Was the change previously discussed in an issue or on the forum?

Closes #5689

Checklist

- [ ] I have added tests for all code changes.
- [ ] I have added documentation for relevant changes (in the manual).

  • There's a new file in changelog/unreleased/ that describes the changes for our users (see template).
  • I'm done! This pull request is ready for review.

@Paulomen2712 Paulomen2712 force-pushed the stats-progress branch 2 times, most recently from 4b5f2db to eacc9e8 Compare February 6, 2026 14:46

@MichaelEischer MichaelEischer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this. This will unfortunately need quite a bit of changes, see the comments for details.

Comment thread cmd/restic/cmd_stats.go Outdated
Comment thread cmd/restic/cmd_stats.go Outdated
Comment thread cmd/restic/cmd_stats.go Outdated
Comment thread cmd/restic/cmd_stats.go
Comment thread cmd/restic/cmd_stats.go Outdated
Comment thread cmd/restic/cmd_stats.go Outdated
@Paulomen2712 Paulomen2712 force-pushed the stats-progress branch 11 times, most recently from 5d06390 to 2a335d9 Compare February 20, 2026 16:18
@Paulomen2712

Copy link
Copy Markdown
Contributor Author

@MichaelEischer
Thanks a lot for the review. Hope my rework makes sense :)
Also while I got your attention: could you look at my other pull requests?
5686, 5681, 5623

@MichaelEischer MichaelEischer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I;ve found a few more small problems, besides those LGTM.

Comment thread cmd/restic/cmd_stats.go
Comment thread cmd/restic/cmd_stats.go Outdated
Comment thread changelog/unreleased/issue-5689 Outdated
@Paulomen2712 Paulomen2712 force-pushed the stats-progress branch 2 times, most recently from 397ee2e to b444d94 Compare May 15, 2026 09:26

@MichaelEischer MichaelEischer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@MichaelEischer MichaelEischer merged commit 6de6cc6 into restic:master May 15, 2026
11 checks passed
@tedpearson

Copy link
Copy Markdown

Hi, Just upgraded to 0.19.0 with this change. However I think not showing the progress bar when --quiet or in non-interactive consoles was missed.

Restic docs say: "Subcommands that support showing progress information such as backup, restore, check and prune will do so unless the quiet flag -q or --quiet is set. When running from a non-interactive console progress reporting is disabled by default to not fill your logs. For interactive and non-interactive consoles the environment variable RESTIC_PROGRESS_FPS can be used to control the frequency of progress reporting. Use for example 0.016666 to only update the progress once per minute."

Example of this not working: (tried with both -q and --quiet)

sudo restic stats --json --mode raw-data -q
[0:15] 100.00%  37 / 37 snapshots, 297613 blobs, 25.623 GiB
{"total_size":27512922762,"total_uncompressed_size":66804624467,"compression_ratio":2.428118053646721,"compression_progress":100,"compression_space_saving":58.81584099676995,"total_blob_count":297613,"snapshots_count":37}

I can open another issue if desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Progress bar for stats

3 participants