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

ListDirSorted check for excludefile

Iakov Davydov557dd8f031d7
diff --git a/fs/operations.go b/fs/operations.go
index 267f7daa9..b3595c7f2 100644
--- a/fs/operations.go
+++ b/fs/operations.go
@@ -622,6 +622,10 @@ func ListDirSorted(fs Fs, includeAll bool, dir string) (entries DirEntries, err
if err != nil {
return nil, err
}
+ if !includeAll && Config.Filter.ListContainsExcludeFile(entries) {
+ Debugf(dir, "Excluded from sync (and deletion) based on exclude file")
+ return nil, nil
+ }
return filterAndSortDir(entries, includeAll, dir, Config.Filter.IncludeObject, Config.Filter.IncludeDirectory)
}