Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

check: log the hash in use like cryptcheck does

Nick Craig-Wood054b467f328e
diff --git a/cmd/check/check.go b/cmd/check/check.go
index 505aa6fe5..11117b147 100644
--- a/cmd/check/check.go
+++ b/cmd/check/check.go
@@ -9,6 +9,7 @@ import (
"github.com/rclone/rclone/cmd"
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/fs/config/flags"
+ "github.com/rclone/rclone/fs/hash"
"github.com/rclone/rclone/fs/operations"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
@@ -156,6 +157,12 @@ to check all the data.
if download {
return operations.CheckDownload(context.Background(), opt)
}
+ hashType := fsrc.Hashes().Overlap(fdst.Hashes()).GetOne()
+ if hashType == hash.None {
+ fs.Errorf(nil, "No common hash found - not using a hash for checks")
+ } else {
+ fs.Infof(nil, "Using %v for hash comparisons", hashType)
+ }
return operations.Check(context.Background(), opt)
})
},