Skip to content

restic copy - add more status counters - issue #5175#5464

Merged
MichaelEischer merged 4 commits into
restic:masterfrom
wplapper:cmd_copy_v2
Nov 16, 2025
Merged

restic copy - add more status counters - issue #5175#5464
MichaelEischer merged 4 commits into
restic:masterfrom
wplapper:cmd_copy_v2

Conversation

@wplapper

@wplapper wplapper commented Aug 4, 2025

Copy link
Copy Markdown
Contributor

'copyTree()' now counts and sizes the blobs in 'copyBlobs' and prints them out via 'Verbosef()'.

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

This PR addresses the issue raised in #5175

code has been added to count and size the changes collected in copyBlobs. These counts are printed out via Verbosef().

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

closes #5175

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.

@wplapper wplapper changed the title restic copy - add more status counters #5319 restic copy - add more status counters Aug 4, 2025
@wplapper wplapper changed the title restic copy - add more status counters restic copy - add more status counters - issue #5175 Aug 7, 2025
Comment thread cmd/restic/cmd_copy.go Outdated
Comment thread cmd/restic/cmd_copy.go Outdated
Comment thread cmd/restic/cmd_copy.go Outdated
Comment thread cmd/restic/cmd_copy.go
Comment thread cmd/restic/cmd_copy.go Outdated
for _, blob := range srcRepo.LookupBlob(blob.Type, blob.ID) {
if blob.Type == restic.TreeBlob {
countTreeBlobs++
sizeTreeBlobs += blob.Length

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.

Length is the size on disk. Is that what we're interested in here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I personally am interested in the length on the disk, since this determined the runtime of the copy command.

Comment thread cmd/restic/cmd_copy.go Outdated
countTreeBlobs, ui.FormatBytes(uint64(sizeTreeBlobs)), len(treePackfiles))
Verbosef(" %7d data blobs with a size %11s in %7d packfiles\n",
countDataBlobs, ui.FormatBytes(uint64(sizeDataBlobs)), len(dataPackfiles))
Verbosef(" %7d all blobs with a size %11s in %7d packfiles\n",

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.

This feels rather redundant. Maybe just print how much data will be copied in total?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Print only the the sum of all blobs.

@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 just have one more small nit. I like the compact statistics output, if there's interest in more details we can still add those later on.

Comment thread changelog/unreleased/pull-5319
@wplapper wplapper mentioned this pull request Nov 9, 2025
4 tasks
'copyTree()' now counts and sizes the blobs in 'copyBlobs' and prints them out
via 'Verbosef()'.
cmd/restic/cmd_copy.go:
add function copyStats() and call it before the actual copying starts.

changelog/unreleased/pull-5319:
rephrased wording of the statistics counters.
reword the description od the PR
fixed typo in changelog/unreleased/pull-5319

@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.

I've rebased the PR to fix the merge conflict.

@MichaelEischer MichaelEischer merged commit d81f95c into restic:master Nov 16, 2025
12 checks passed
@wplapper wplapper deleted the cmd_copy_v2 branch November 24, 2025 06:24
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.

restic copy - give more information in summary, like backup

2 participants