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

drive: Add error for purge with --drive-trashed-only - fixes #3407

ginvine1e7bc359be1b
diff --git a/backend/drive/drive.go b/backend/drive/drive.go
index cbf3e359d..dc0605483 100644
--- a/backend/drive/drive.go
+++ b/backend/drive/drive.go
@@ -1941,6 +1941,9 @@ func (f *Fs) Purge(ctx context.Context) error {
if f.root == "" {
return errors.New("can't purge root directory")
}
+ if f.opt.TrashedOnly {
+ return errors.New("Can't purge with --drive-trashed-only. Use delete if you want to selectively delete files")
+ }
err := f.dirCache.FindRoot(ctx, false)
if err != nil {
return err