Merge pull request #7499 from influxdata/jl-export-doc

Update `influx_inspect export` doc
pull/7531/head
joelegasse 2016-10-26 14:17:27 -04:00 committed by GitHub
commit 05c252696e
2 changed files with 10 additions and 36 deletions

View File

@ -57,17 +57,21 @@ func NewCommand() *Command {
func (cmd *Command) Run(args ...string) error {
var start, end string
fs := flag.NewFlagSet("export", flag.ExitOnError)
fs.StringVar(&cmd.dataDir, "datadir", os.Getenv("HOME")+"/.influxdb/data", "Data storage path. [$HOME/.influxdb/data]")
fs.StringVar(&cmd.walDir, "waldir", os.Getenv("HOME")+"/.influxdb/wal", "Wal storage path. [$HOME/.influxdb/wal]")
fs.StringVar(&cmd.dataDir, "datadir", os.Getenv("HOME")+"/.influxdb/data", "Data storage path")
fs.StringVar(&cmd.walDir, "waldir", os.Getenv("HOME")+"/.influxdb/wal", "WAL storage path")
fs.StringVar(&cmd.out, "out", os.Getenv("HOME")+"/.influxdb/export", "Destination file to export to")
fs.StringVar(&cmd.database, "database", "", "Optional: the database to export")
fs.StringVar(&cmd.retentionPolicy, "retention", "", "Optional: the retention policy to export (requires db parameter to be specified)")
fs.StringVar(&cmd.retentionPolicy, "retention", "", "Optional: the retention policy to export (requires -database)")
fs.StringVar(&start, "start", "", "Optional: the start time to export")
fs.StringVar(&end, "end", "", "Optional: the end time to export")
fs.BoolVar(&cmd.compress, "compress", false, "Compress the output")
fs.SetOutput(cmd.Stdout)
fs.Usage = cmd.printUsage
fs.Usage = func() {
fmt.Fprintf(cmd.Stdout, "Exports TSM files into InfluxDB line protocol format.\n\n")
fmt.Fprintf(cmd.Stdout, "Usage: %s export [flags]\n\n", filepath.Base(os.Args[0]))
fs.PrintDefaults()
}
if err := fs.Parse(args); err != nil {
return err
@ -390,33 +394,3 @@ func (cmd *Command) writeWALFiles(w io.WriteCloser, files []string, key string)
return nil
}
// printUsage prints the usage message to STDERR.
func (cmd *Command) printUsage() {
usage := fmt.Sprintf(`Exports TSM files into InfluxDB line protocol format.
Usage: influx_inspect export [flags]
-datadir <path>
Data storage path
Defaults to "%[1]s/.influxdb/data".
-waldir <path>
WAL storage path
Defaults to "%[1]s/.influxdb/wal".
-out <path>
Destination file to export to.
Defaults to "%[1]s/.influxdb/export".
-database <name>
Optional. Database to export.
-retention <name>
Optional. the retention policy to export (requires db parameter to be specified).
-start-time <time>
Optional. the start time to export.
-end-time <time>
Optional. the end time to export.
-compress
Optional. Compress the output. Defaults to "false".
`, os.Getenv("HOME"))
fmt.Fprintf(cmd.Stdout, usage)
}

View File

@ -57,10 +57,10 @@ EXPORT OPTIONS
-wal-dir <path>::
Wal storage path. Defaults to '~/.influxdb/wal'.
-start-time <timestamp>::
-start <timestamp>::
The start time of the export. The timestamp is in RFC3339 format. Optional.
-end-time <timestamp>::
-end <timestamp>::
The end time of the export. The timestamp is in RFC3339 format. Optional.
-out <path>::