"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
fs: add more detailed logging for file includes/excludes
Kyle Reynolds783599114760
diff --git a/fs/filter/filter.go b/fs/filter/filter.goindex 736495f4d..ede0828ee 100644--- a/fs/filter/filter.go+++ b/fs/filter/filter.go@@ -330,23 +330,30 @@ func (f *Filter) DirContainsExcludeFile(ctx context.Context, fremote fs.Fs, remo}// Include returns whether this object should be included into the-// sync or not+// sync or not and logs the reason for exclusion if not includedfunc (f *Filter) Include(remote string, size int64, modTime time.Time, metadata fs.Metadata) bool {// filesFrom takes precedenceif f.files != nil {_, include := f.files[remote]+ if !include {+ fs.Debugf(remote, "Excluded (FilesFrom Filter)")+ }return include}if !f.ModTimeFrom.IsZero() && modTime.Before(f.ModTimeFrom) {+ fs.Debugf(remote, "Excluded (ModTime Filter)")return false}if !f.ModTimeTo.IsZero() && modTime.After(f.ModTimeTo) {+ fs.Debugf(remote, "Excluded (ModTime Filter)")return false}if f.Opt.MinSize >= 0 && size < int64(f.Opt.MinSize) {+ fs.Debugf(remote, "Excluded (Size Filter)")return false}if f.Opt.MaxSize >= 0 && size > int64(f.Opt.MaxSize) {+ fs.Debugf(remote, "Excluded (Size Filter)")return false}if f.metaRules.len() > 0 {@@ -360,10 +367,15 @@ func (f *Filter) Include(remote string, size int64, modTime time.Time, metadatametadatas = append(metadatas, "\x00=\x00")}if !f.metaRules.includeMany(metadatas) {+ fs.Debugf(remote, "Excluded (Metadata Filter)")return false}}- return f.IncludeRemote(remote)+ include := f.IncludeRemote(remote)+ if !include {+ fs.Debugf(remote, "Excluded (Path Filter)")+ }+ return include}// IncludeObject returns whether this object should be included intodiff --git a/fs/walk/walk.go b/fs/walk/walk.goindex 01251ea1b..ada7a284d 100644--- a/fs/walk/walk.go+++ b/fs/walk/walk.go@@ -320,8 +320,6 @@ func listR(ctx context.Context, f fs.Fs, path string, includeAll bool, listType}if include {filteredEntries = append(filteredEntries, entry)- } else {- fs.Debugf(entry, "Excluded from sync (and deletion)")}}entries = filteredEntries@@ -480,8 +478,6 @@ func walkRDirTree(ctx context.Context, f fs.Fs, startPath string, includeAll boodirs.Add(x)excluded = false}- } else {- fs.Debugf(x, "Excluded from sync (and deletion)")}// Make sure we include any parent directories of excluded objectsif excluded {@@ -511,7 +507,6 @@ func walkRDirTree(ctx context.Context, f fs.Fs, startPath string, includeAll booif basename == excludeFile {excludeDir := parentDir(x.Remote())toPrune[excludeDir] = true- fs.Debugf(basename, "Excluded from sync (and deletion) based on exclude file")}}}@@ -529,8 +524,6 @@ func walkRDirTree(ctx context.Context, f fs.Fs, startPath string, includeAll boodirs.AddDir(x)}}- } else {- fs.Debugf(x, "Excluded from sync (and deletion)")}default:return fmt.Errorf("unknown object type %T", entry)