influxdata / docs-v2

InfluxData Documentation that covers InfluxDB Cloud, InfluxDB OSS 2.x, InfluxDB OSS 1.x, InfluxDB Enterprise, Telegraf, Chronograf, Kapacitor, and Flux.
https://docs.influxdata.com
MIT License
69 stars 258 forks source link

Supports both Linux and macOS date command options. #5510

Closed hkato closed 8 hours ago

hkato commented 3 days ago

Describe your proposal here.

About influx delete command examples. ref. #5070 #5223

influx delete --bucket example-bucket \
  --start '1970-01-01T00:00:00Z' \
  --stop $(date --utc +"%Y-%m-%dT%H:%M:%SZ") \
  --predicate '_measurement="example-measurement" AND exampleTag="exampleTagValue"'

GNU(Linux) and BSD(macOS) date commands are different.

GNU date (Debian, etc)

$ man date

...snip...

       -u, --utc, --universal
              print or set Coordinated Universal Time (UTC)

...snip...

BSD date (macOS)

$ man date

...snip...

     -u      Display or set the date in UTC (Coordinated Universal) time.  By default date displays the time in the time zone described by /etc/localtime or the TZ environment variable.

...snip...

BSD date command does not support '--utc' option.

So, -u option is better. Both macOS and Linux are supported.

influx delete --bucket example-bucket \
  --start '1970-01-01T00:00:00Z' \
  --stop $(date -u +"%Y-%m-%dT%H:%M:%SZ") \
  --predicate '_measurement="example-measurement" AND exampleTag="exampleTagValue"'
Relevant URLs
hkato commented 8 hours ago

@sanderson Thank you for merging. close this issue.