"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
drive: add --drive-size-as-quota to show storage quota usage for file size - fixes #3135
Garry McNultye2fde62cd9ee
diff --git a/backend/drive/drive.go b/backend/drive/drive.goindex 63d71aa9b..943ec46a5 100644--- a/backend/drive/drive.go+++ b/backend/drive/drive.go@@ -367,6 +367,14 @@ will download it anyway.`,Default: false,Help: "Keep new head revision of each file forever.",Advanced: true,+ }, {+ Name: "size_as_quota",+ Default: false,+ Help: `Show storage quota usage for file size.++The storage used by a file is the size of the current version plus any+older versions that have been set to keep forever.`,+ Advanced: true,}, {Name: "v2_download_min_size",Default: fs.SizeSuffix(-1),@@ -434,6 +442,7 @@ type Options struct {ChunkSize fs.SizeSuffix `config:"chunk_size"`AcknowledgeAbuse bool `config:"acknowledge_abuse"`KeepRevisionForever bool `config:"keep_revision_forever"`+ SizeAsQuota bool `config:"size_as_quota"`V2DownloadMinSize fs.SizeSuffix `config:"v2_download_min_size"`PacerMinSleep fs.Duration `config:"pacer_min_sleep"`PacerBurst int `config:"pacer_burst"`@@ -643,6 +652,9 @@ func (f *Fs) list(dirIDs []string, title string, directoriesOnly, filesOnly, incif f.opt.SkipChecksumGphotos {fields += ",spaces"}+ if f.opt.SizeAsQuota {+ fields += ",quotaBytesUsed"+ }fields = fmt.Sprintf("files(%s),nextPageToken", fields)@@ -1018,13 +1030,17 @@ func (f *Fs) newBaseObject(remote string, info *drive.File) baseObject {if f.opt.UseCreatedDate {modifiedDate = info.CreatedTime}+ size := info.Size+ if f.opt.SizeAsQuota {+ size = info.QuotaBytesUsed+ }return baseObject{fs: f,remote: remote,id: info.Id,modifiedDate: modifiedDate,mimeType: info.MimeType,- bytes: info.Size,+ bytes: size,}}