aboutsummaryrefslogtreecommitdiff
path: root/weed/command/filer_backup.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2024-07-12 11:17:28 -0700
committerchrislu <chris.lu@gmail.com>2024-07-12 11:17:30 -0700
commit3a82f5ffad3122a3adeb9e652cee72420a2f6f97 (patch)
treebc2df43aee7f59e8b183eadb52ef6b3fdce14e06 /weed/command/filer_backup.go
parentec9e7493b34df5c13462cdaeab5b35f152d0cb68 (diff)
downloadseaweedfs-3a82f5ffad3122a3adeb9e652cee72420a2f6f97.tar.xz
seaweedfs-3a82f5ffad3122a3adeb9e652cee72420a2f6f97.zip
ensure metadata follow a specific folder
fix https://github.com/seaweedfs/seaweedfs/issues/5774
Diffstat (limited to 'weed/command/filer_backup.go')
-rw-r--r--weed/command/filer_backup.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/weed/command/filer_backup.go b/weed/command/filer_backup.go
index 43b7c6256..a66c53f8e 100644
--- a/weed/command/filer_backup.go
+++ b/weed/command/filer_backup.go
@@ -9,6 +9,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/util"
"google.golang.org/grpc"
"regexp"
+ "strings"
"time"
)
@@ -148,12 +149,17 @@ func doFilerBackup(grpcDialOption grpc.DialOption, backupOption *FilerBackupOpti
}()
}
+ prefix := sourcePath
+ if !strings.HasSuffix(prefix, "/") {
+ prefix = prefix + "/"
+ }
+
metadataFollowOption := &pb.MetadataFollowOption{
ClientName: "backup_" + dataSink.GetName(),
ClientId: clientId,
ClientEpoch: clientEpoch,
SelfSignature: 0,
- PathPrefix: sourcePath,
+ PathPrefix: prefix,
AdditionalPathPrefixes: nil,
DirectoriesToWatch: nil,
StartTsNs: startFrom.UnixNano(),