mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
selectively export files
This commit is contained in:
parent
ff4189ab25
commit
6c45787a37
|
@ -34,6 +34,7 @@ var (
|
||||||
// filerExportOutputFile = cmdFilerExport.Flag.String("output", "", "the output file. If empty, only list out the directory tree")
|
// 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")
|
||||||
filerExportTargetStore = cmdFilerExport.Flag.String("targetStore", "", "the target store name in filer.toml, or \"notification\" to export all files to message queue")
|
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")
|
dirListLimit = cmdFilerExport.Flag.Int("dirListLimit", 100000, "limit directory list size")
|
||||||
dryRun = cmdFilerExport.Flag.Bool("dryRun", false, "not actually moving data")
|
dryRun = cmdFilerExport.Flag.Bool("dryRun", false, "not actually moving data")
|
||||||
)
|
)
|
||||||
|
@ -127,7 +128,7 @@ func runFilerExport(cmd *Command, args []string) bool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
doTraverse(&stat, sourceStore, filer2.FullPath("/"), 0, fn)
|
doTraverse(&stat, sourceStore, filer2.FullPath(*dir), 0, fn)
|
||||||
|
|
||||||
glog.Infof("processed %d directories, %d files", stat.directoryCount, stat.fileCount)
|
glog.Infof("processed %d directories, %d files", stat.directoryCount, stat.fileCount)
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ func runFilerReplicate(cmd *Command, args []string) bool {
|
||||||
if err = replicator.Replicate(key, m); err != nil {
|
if err = replicator.Replicate(key, m); err != nil {
|
||||||
glog.Errorf("replicate %s: %+v", key, err)
|
glog.Errorf("replicate %s: %+v", key, err)
|
||||||
} else {
|
} else {
|
||||||
glog.V(4).Infof("replicated %s", key)
|
glog.V(1).Infof("replicated %s", key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue