"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
Implement --ignore-checksum flag
Nick Craig-Wood9d331ce04b00
diff --git a/docs/content/docs.md b/docs/content/docs.mdindex 459eeb53a..43bedc60f 100644--- a/docs/content/docs.md+++ b/docs/content/docs.md@@ -313,6 +313,15 @@ Do a trial run with no permanent changes. Use this to see what rclonewould do without actually doing it. Useful when setting up the `sync`command which deletes files in the destination.+### --ignore-checksum ###++Normally rclone will check that the checksums of transferred files+match, and give an error "corrupted on transfer" if they don't.++You can use this option to skip that check. You should only use it if+you have had the "corrupted on transfer" error message and you are+sure you might want to transfer potentially corrupted data.+### --ignore-existing ###Using this option will make rclone unconditionally skip all filesdiff --git a/fs/config.go b/fs/config.goindex fbf345571..4231d3126 100644--- a/fs/config.go+++ b/fs/config.go@@ -83,6 +83,7 @@ var (noGzip = BoolP("no-gzip-encoding", "", false, "Don't set Accept-Encoding: gzip.")maxDepth = IntP("max-depth", "", -1, "If set limits the recursion depth to this.")ignoreSize = BoolP("ignore-size", "", false, "Ignore size when skipping use mod-time or checksum.")+ ignoreChecksum = BoolP("ignore-checksum", "", false, "Skip post copy check of checksums.")noTraverse = BoolP("no-traverse", "", false, "Don't traverse destination file system on copy.")noUpdateModTime = BoolP("no-update-modtime", "", false, "Don't update destination mod-time if files identical.")backupDir = StringP("backup-dir", "", "", "Make backups into hierarchy based in DIR.")@@ -207,6 +208,7 @@ type ConfigInfo struct {NoGzip bool // Disable compressionMaxDepth intIgnoreSize bool+ IgnoreChecksum boolNoTraverse boolNoUpdateModTime boolDataRateUnit string@@ -308,6 +310,7 @@ func LoadConfig() {Config.NoGzip = *noGzipConfig.MaxDepth = *maxDepthConfig.IgnoreSize = *ignoreSize+ Config.IgnoreChecksum = *ignoreChecksumConfig.NoTraverse = *noTraverseConfig.NoUpdateModTime = *noUpdateModTimeConfig.BackupDir = *backupDirdiff --git a/fs/operations.go b/fs/operations.goindex f24f12009..4b0de106e 100644--- a/fs/operations.go+++ b/fs/operations.go@@ -331,7 +331,7 @@ func Copy(f Fs, dst Object, remote string, src Object) (err error) {if err != nil {Stats.Error()ErrorLog(dst, "Failed to read hash: %v", err)- } else if !HashEquals(srcSum, dstSum) {+ } else if !Config.IgnoreSize && !HashEquals(srcSum, dstSum) {Stats.Error()err = errors.Errorf("corrupted on transfer: %v hash differ %q vs %q", hashType, srcSum, dstSum)ErrorLog(dst, "%v", err)