"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
s3: add server side copy real time accounting
Nick Craig-Woodb8d2ce8962bd
diff --git a/backend/s3/s3.go b/backend/s3/s3.goindex 02398a34f..440890f8c 100644--- a/backend/s3/s3.go+++ b/backend/s3/s3.go@@ -63,6 +63,7 @@ import ("github.com/rclone/rclone/lib/pool""github.com/rclone/rclone/lib/readers""github.com/rclone/rclone/lib/rest"+ "github.com/rclone/rclone/lib/transferaccounter""github.com/rclone/rclone/lib/version")@@ -3006,6 +3007,8 @@ func (f *Fs) copyMultipart(ctx context.Context, copyReq *s3.CopyObjectInput, dstnumParts := (srcSize-1)/partSize + 1fs.Debugf(src, "Starting multipart copy with %d parts", numParts)+ account := transferaccounter.Get(ctx)+ account.Start()var (parts = make([]types.CompletedPart, numParts)@@ -3040,6 +3043,11 @@ func (f *Fs) copyMultipart(ctx context.Context, copyReq *s3.CopyObjectInput, dstPartNumber: &partNum,ETag: uout.CopyPartResult.ETag,}+ copied := partSize+ if int64(partNum) == numParts {+ copied = srcSize - (numParts-1)*partSize+ }+ account.Add(copied)return nil})}