Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy command too verbose #4033

Closed
sedlund opened this issue Nov 24, 2022 · 3 comments · Fixed by #4066
Closed

copy command too verbose #4033

sedlund opened this issue Nov 24, 2022 · 3 comments · Fixed by #4066

Comments

@sedlund
Copy link
Contributor

sedlund commented Nov 24, 2022

When there are 1000's of snapshots using the copy command to a remote is quite chatty with this.

Verbosef("skipping source snapshot %s, was already copied to snapshot %s\n", sn.ID().Str(), originalSn.ID().Str())

Can this be changed toVerboseff ?

diff --git a/cmd/restic/cmd_copy.go b/cmd/restic/cmd_copy.go
index 08df7e8a..14ab1917 100644
--- a/cmd/restic/cmd_copy.go
+++ b/cmd/restic/cmd_copy.go
@@ -120,7 +120,6 @@ func runCopy(ctx context.Context, opts CopyOptions, gopts GlobalOptions, args []
        visitedTrees := restic.NewIDSet()

        for sn := range FindFilteredSnapshots(ctx, srcSnapshotLister, srcRepo, opts.Hosts, opts.Tags, opts.Paths, args) {
-               Verbosef("\nsnapshot %s of %v at %s)\n", sn.ID().Str(), sn.Paths, sn.Time)

                // check whether the destination has a snapshot with the same persistent ID which has similar snapshot fields
                srcOriginal := *sn.ID()
@@ -131,7 +130,8 @@ func runCopy(ctx context.Context, opts CopyOptions, gopts GlobalOptions, args []
                        isCopy := false
                        for _, originalSn := range originalSns {
                                if similarSnapshots(originalSn, sn) {
-                                       Verbosef("skipping source snapshot %s, was already copied to snapshot %s\n", sn.ID().Str(), originalSn.ID().Str())
+                                       Verboseff("\nsnapshot %s of %v at %s)\n", sn.ID().Str(), sn.Paths, sn.Time)
+                                       Verboseff("skipping source snapshot %s, was already copied to snapshot %s\n", sn.ID().Str(), originalSn.ID().Str())
                                        isCopy = true
                                        break
                                }
@@ -140,6 +140,7 @@ func runCopy(ctx context.Context, opts CopyOptions, gopts GlobalOptions, args []
                                continue
                        }
                }
+               Verbosef("\nsnapshot %s of %v at %s)\n", sn.ID().Str(), sn.Paths, sn.Time)
                Verbosef("  copy started, this may take a while...\n")
                if err := copyTree(ctx, srcRepo, dstRepo, visitedTrees, *sn.Tree, gopts.Quiet); err != nil {
                        return err
@MichaelEischer
Copy link
Member

Sounds like a good idea. Would you mind opening a pull request?

@sedlund
Copy link
Contributor Author

sedlund commented Nov 27, 2022

@MichaelEischer will do. Thanks

@MichaelEischer
Copy link
Member

Fixed by #4066.

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 a pull request may close this issue.

2 participants