"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
sync: fix expecting SFTP to have MkdirMetadata method: optional feature not implemented
Nick Craig-Wood39f8d039fe07
diff --git a/fs/sync/sync.go b/fs/sync/sync.goindex 0d1cfc6e6..67998268f 100644--- a/fs/sync/sync.go+++ b/fs/sync/sync.go@@ -98,7 +98,7 @@ type syncCopyMove struct {// For keeping track of delayed modtime setstype setDirModTime struct {- src fs.Directory // if set the metadata should be set too+ src fs.Directorydst fs.Directorydir stringmodTime time.Time@@ -1109,7 +1109,6 @@ func (s *syncCopyMove) copyDirMetadata(ctx context.Context, f fs.Fs, dst fs.Direif !s.setDirModTimeAfter && equal {return nil}- setMeta := trueif s.setDirModTimeAfter && equal {newDst = dst} else if s.copyEmptySrcDirs {@@ -1126,7 +1125,6 @@ func (s *syncCopyMove) copyDirMetadata(ctx context.Context, f fs.Fs, dst fs.Direerr = operations.Mkdir(ctx, f, dir)}} else {- setMeta = s.setDirMetadatanewDst = dst}// If we need to set modtime after and we created a dir, then save it for later@@ -1145,14 +1143,12 @@ func (s *syncCopyMove) copyDirMetadata(ctx context.Context, f fs.Fs, dst fs.Dires.setDirModTimesMaxLevel = level}set := setDirModTime{+ src: src,dst: newDst,dir: dir,modTime: src.ModTime(ctx),level: level,}- if setMeta {- set.src = src- }s.setDirModTimes = append(s.setDirModTimes, set)s.setDirModTimeMu.Unlock()fs.Debugf(nil, "Added delayed dir = %q, newDst=%v", dir, newDst)@@ -1202,8 +1198,7 @@ func (s *syncCopyMove) setDelayedDirModTimes(ctx context.Context) error {}g.Go(func() error {var err error- // if item.src is set must copy full metadata- if item.src != nil {+ if s.setDirMetadata {_, err = operations.CopyDirMetadata(gCtx, s.fdst, item.dst, item.dir, item.src)} else {_, err = operations.SetDirModTime(gCtx, s.fdst, item.dst, item.dir, item.modTime)