From a31f2907f05bf7fea9a4e341eb3c6f44ca815cd1 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 29 Aug 2021 18:46:28 -0700 Subject: cloud drive: filer.remote.sync supports remove folder --- weed/command/filer_remote_sync.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'weed/command') diff --git a/weed/command/filer_remote_sync.go b/weed/command/filer_remote_sync.go index 48713093e..8d2719660 100644 --- a/weed/command/filer_remote_sync.go +++ b/weed/command/filer_remote_sync.go @@ -164,6 +164,10 @@ func followUpdatesAndUploadToRemote(option *RemoteSyncOptions, filerSource *sour if message.OldEntry != nil && message.NewEntry == nil { glog.V(2).Infof("delete: %+v", resp) dest := toRemoteStorageLocation(util.FullPath(mountedDir), util.NewFullPath(resp.Directory, message.OldEntry.Name), remoteStorageMountLocation) + if message.OldEntry.IsDirectory { + glog.V(0).Infof("rmdir %s", remote_storage.FormatLocation(dest)) + return client.RemoveDirectory(dest) + } glog.V(0).Infof("delete %s", remote_storage.FormatLocation(dest)) return client.DeleteFile(dest) } -- cgit v1.2.3