Use the non-interactive mode of the CLI: http://docs.influxdata.com/influxdb/v1.0/tools/shell/#execute-an-influxql-command-and-quit-with-execute
e.g. $ influx -execute 'CREATE CONTINUOUS QUERY "cq_tasks_counts" ON "metrics" BEGIN SELECT count(*) INTO hourlyTasksCounts FROM tasks GROUP BY time(1h), * END' You can list the various CQs, RPs, etc with the SHOW queries: http://docs.influxdata.com/influxdb/v1.0/query_language/schema_exploration/ On Fri, Oct 21, 2016 at 3:18 PM, <jobl...@gmail.com> wrote: > Is it possible to create a file that has all of your continuous queries, > data retentions, and users? I've looked through the doc and was not able > to figure it out. > > I have the need to create copies of the same influx database for test > environments and for production > > for instances, I have this cq in a file cq.sql that contains this > > ---------------------------- > use r1metrics > > CREATE CONTINUOUS QUERY "cq_tasks_counts" ON "metrics" > BEGIN > SELECT > count(*) > INTO hourlyTasksCounts > FROM tasks > GROUP BY time(1h), * > END > ---------------------------- > > I tried > > influx -import -path cq.sql > > and it looks like it doesn't like that cq being on multiple lines > > Is there a continuation char? I tried putting \ and that didn't work. > > Thanks > > -- > Remember to include the version number! > --- > You received this message because you are subscribed to the Google Groups > "InfluxData" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to influxdb+unsubscr...@googlegroups.com. > To post to this group, send email to influxdb@googlegroups.com. > Visit this group at https://groups.google.com/group/influxdb. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/influxdb/a4a8c5ce-2533-460b-9489-cfd9fc3054ec%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Sean Beckett Director of Support and Professional Services InfluxDB -- Remember to include the version number! --- You received this message because you are subscribed to the Google Groups "InfluxData" group. To unsubscribe from this group and stop receiving emails from it, send an email to influxdb+unsubscr...@googlegroups.com. To post to this group, send email to influxdb@googlegroups.com. Visit this group at https://groups.google.com/group/influxdb. To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/CALGqCvMdhR%3D46d5hKJm3n1YDbAGs3Lw993d7TBJWq3d3i_HKvA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.