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

operations: remove partials when the copy fails

Nick Craig-Woodda955e5d4f44
diff --git a/fs/operations/operations.go b/fs/operations/operations.go
index 4308df7fa..8c20fbe40 100644
--- a/fs/operations/operations.go
+++ b/fs/operations/operations.go
@@ -529,6 +529,9 @@ func Copy(ctx context.Context, f fs.Fs, dst fs.Object, remote string, src fs.Obj
if err != nil {
err = fs.CountError(err)
fs.Errorf(src, "Failed to copy: %v", err)
+ if !inplace {
+ removeFailedPartialCopy(ctx, f, remotePartial)
+ }
return newDst, err
}