diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-11-04 12:59:29 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-11-04 12:59:29 -0800 |
| commit | 85d1d99459f785ba1ea9638f072d2ba5dfe830e0 (patch) | |
| tree | 5284c5148e4a003c9b42dc7a62b87ef46b1490bb | |
| parent | 6c45787a371b6cc1416f50c927e738639ba83f13 (diff) | |
| download | seaweedfs-85d1d99459f785ba1ea9638f072d2ba5dfe830e0.tar.xz seaweedfs-85d1d99459f785ba1ea9638f072d2ba5dfe830e0.zip | |
default "weed export to current enabled store"
| -rw-r--r-- | weed/command/filer_export.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/command/filer_export.go b/weed/command/filer_export.go index 85259408e..c1a5dce7f 100644 --- a/weed/command/filer_export.go +++ b/weed/command/filer_export.go @@ -32,7 +32,7 @@ var cmdFilerExport = &Command{ var ( // filerExportOutputFile = cmdFilerExport.Flag.String("output", "", "the output file. If empty, only list out the directory tree") - filerExportSourceStore = cmdFilerExport.Flag.String("sourceStore", "", "the source store name in filer.toml") + filerExportSourceStore = cmdFilerExport.Flag.String("sourceStore", "", "the source store name in filer.toml, default to currently enabled store") filerExportTargetStore = cmdFilerExport.Flag.String("targetStore", "", "the target store name in filer.toml, or \"notification\" to export all files to message queue") dir = cmdFilerExport.Flag.String("dir", "/", "only process files under this directory") dirListLimit = cmdFilerExport.Flag.Int("dirListLimit", 100000, "limit directory list size") @@ -52,7 +52,7 @@ func runFilerExport(cmd *Command, args []string) bool { var sourceStore, targetStore filer2.FilerStore for _, store := range filer2.Stores { - if store.GetName() == *filerExportSourceStore { + if store.GetName() == *filerExportSourceStore || *filerExportSourceStore == "" && config.GetBool(store.GetName()+".enabled") { viperSub := config.Sub(store.GetName()) if err := store.Initialize(viperSub); err != nil { glog.Fatalf("Failed to initialize source store for %s: %+v", |
