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

rclone: Don't purge if --dry-run set

Nick Craig-Woodeb2b4ea8aa36
diff --git a/fs/operations.go b/fs/operations.go
index 5ad170208..7c838d635 100644
--- a/fs/operations.go
+++ b/fs/operations.go
@@ -475,10 +475,14 @@ func Rmdir(f Fs) error {
// FIXME doesn't delete local directories
func Purge(f Fs) error {
if purger, ok := f.(Purger); ok {
- err := purger.Purge()
- if err != nil {
- Stats.Error()
- return err
+ if Config.DryRun {
+ Debug(f, "Not purging as --dry-run set")
+ } else {
+ err := purger.Purge()
+ if err != nil {
+ Stats.Error()
+ return err
+ }
}
} else {
DeleteFiles(f.List())