"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
new option: --exclude-if-present
Iakov Davydov37aaa19f3a1d
diff --git a/fs/filter.go b/fs/filter.goindex eaa8255c4..cc36d7dad 100644--- a/fs/filter.go+++ b/fs/filter.go@@ -23,6 +23,7 @@ var (filterFrom = StringArrayP("filter-from", "", nil, "Read filtering patterns from a file")excludeRule = StringArrayP("exclude", "", nil, "Exclude files matching pattern")excludeFrom = StringArrayP("exclude-from", "", nil, "Read exclude patterns from file")+ excludeFile = StringP("exclude-if-present", "", "", "Exclude directories if filename is present")includeRule = StringArrayP("include", "", nil, "Include files matching pattern")includeFrom = StringArrayP("include-from", "", nil, "Read include patterns from file")filesFrom = StringArrayP("files-from", "", nil, "Read list of source-file names from file")@@ -105,6 +106,7 @@ type Filter struct {ModTimeTo time.TimefileRules rulesdirRules rules+ ExcludeFile stringfiles FilesMap // files if filesFromdirs FilesMap // dirs from filesFrom}@@ -221,6 +223,7 @@ func NewFilter() (f *Filter, err error) {}}}+ f.ExcludeFile = *excludeFileif addImplicitExclude {err = f.Add(false, "/**")if err != nil {@@ -372,7 +375,8 @@ func (f *Filter) InActive() bool {f.MinSize < 0 &&f.MaxSize < 0 &&f.fileRules.len() == 0 &&- f.dirRules.len() == 0)+ f.dirRules.len() == 0 &&+ len(f.ExcludeFile) == 0)}// includeRemote returns whether this remote passes the filter rules.