aboutsummaryrefslogtreecommitdiff
path: root/weed/command
diff options
context:
space:
mode:
Diffstat (limited to 'weed/command')
-rw-r--r--weed/command/filer_backup.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/weed/command/filer_backup.go b/weed/command/filer_backup.go
index 2ae48cd40..cd63f49f7 100644
--- a/weed/command/filer_backup.go
+++ b/weed/command/filer_backup.go
@@ -93,9 +93,12 @@ 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 {
- return fmt.Errorf("error compile regexp %v for exclude file name: %+v", *backupOption.excludeFileName, err)
+ 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()