Browse Source

fix: excludeFileName is empty

pull/5003/head
Konstantin Lebedev 1 year ago
committed by Chris Lu
parent
commit
e55fa68848
  1. 7
      weed/command/filer_backup.go

7
weed/command/filer_backup.go

@ -93,10 +93,13 @@ func doFilerBackup(grpcDialOption grpc.DialOption, backupOption *FilerBackupOpti
sourceFiler := pb.ServerAddress(*backupOption.filer)
sourcePath := *backupOption.path
excludePaths := util.StringSplit(*backupOption.excludePaths, ",")
reExcludeFileName, err := regexp.Compile(*backupOption.excludeFileName)
if err != nil {
var reExcludeFileName *regexp.Regexp
if *backupOption.excludeFileName != "" {
var err error
if reExcludeFileName, err = regexp.Compile(*backupOption.excludeFileName); err != nil {
return fmt.Errorf("error compile regexp %v for exclude file name: %+v", *backupOption.excludeFileName, err)
}
}
timeAgo := *backupOption.timeAgo
targetPath := dataSink.GetSinkToDirectory()
debug := *backupOption.debug

Loading…
Cancel
Save