2019-01-16 17:41:37 +00:00
|
|
|
---
|
|
|
|
title: Task configuration options
|
|
|
|
seotitle: InfluxDB task configuration options
|
|
|
|
description: placeholder
|
|
|
|
menu:
|
|
|
|
v2_0:
|
|
|
|
name: Task options
|
|
|
|
parent: Process data
|
|
|
|
weight: 5
|
|
|
|
---
|
|
|
|
|
2019-01-16 22:26:44 +00:00
|
|
|
Task options define specific information about the task and are specified in your
|
|
|
|
Flux script or in the InfluxDB user interface (UI).
|
|
|
|
The following task options are available:
|
|
|
|
|
|
|
|
- [name](#name)
|
|
|
|
- [every](#every)
|
|
|
|
- [cron](#cron)
|
|
|
|
- [offset](#offset)
|
|
|
|
- [concurrency](#concurrency)
|
|
|
|
- [retry](#retry)
|
|
|
|
|
|
|
|
{{% note %}}
|
|
|
|
`every` and `cron` are mutually exclusive, but at least one is required.
|
|
|
|
{{% /note %}}
|
|
|
|
|
|
|
|
## name
|
|
|
|
The name of the task.
|
|
|
|
If no name is specified, the generated task ID is used.
|
2019-01-16 17:41:37 +00:00
|
|
|
|
|
|
|
_**Data type:** String_
|
|
|
|
|
2019-01-16 22:26:44 +00:00
|
|
|
```js
|
|
|
|
options task = {
|
|
|
|
// ...
|
|
|
|
name: "taskName",
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## every
|
|
|
|
The interval at which the task runs.
|
2019-01-16 17:41:37 +00:00
|
|
|
|
|
|
|
_**Data type:** Duration_
|
|
|
|
|
2019-01-16 22:26:44 +00:00
|
|
|
```js
|
|
|
|
options task = {
|
|
|
|
every: 1h,
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## cron
|
|
|
|
The cron schedule on which the task runs. Cron execution is based on system time.
|
2019-01-16 17:41:37 +00:00
|
|
|
|
|
|
|
_**Data type:** String_
|
|
|
|
|
2019-01-16 22:26:44 +00:00
|
|
|
```js
|
|
|
|
options task = {
|
|
|
|
cron: "0 * * * *",
|
|
|
|
}
|
|
|
|
```
|
2019-01-16 17:41:37 +00:00
|
|
|
|
2019-01-16 22:26:44 +00:00
|
|
|
## offset
|
|
|
|
Delays the execution of the task but preserves the original time range.
|
|
|
|
For example, if a task is to run on the hour, a `10m` offset will delay it to 10
|
|
|
|
minutes after the hour, but all time ranges defined in the task are relative to
|
|
|
|
the specified execution time.
|
|
|
|
A common use case is to allow late data to come in before executing the task.
|
2019-01-16 17:41:37 +00:00
|
|
|
|
|
|
|
_**Data type:** Duration_
|
|
|
|
|
2019-01-16 22:26:44 +00:00
|
|
|
```js
|
|
|
|
options task = {
|
|
|
|
// ...
|
|
|
|
offset: "0 * * * *",
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## concurrency
|
|
|
|
The number task executions that can run concurrently.
|
|
|
|
If the concurrency limit is reached, all subsequent executions of the task are be queued
|
|
|
|
until other running task executions complete.
|
2019-01-16 17:41:37 +00:00
|
|
|
|
|
|
|
_**Data type:** Integer_
|
|
|
|
|
2019-01-16 22:26:44 +00:00
|
|
|
```js
|
|
|
|
options task = {
|
|
|
|
// ...
|
|
|
|
concurrency: 2,
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## retry
|
|
|
|
The number of times to retry the task before it is considered as having failed.
|
2019-01-16 17:41:37 +00:00
|
|
|
|
|
|
|
_**Data type:** Integer_
|
2019-01-16 22:26:44 +00:00
|
|
|
|
|
|
|
```js
|
|
|
|
options task = {
|
|
|
|
// ...
|
|
|
|
retry: 2,
|
|
|
|
}
|
|
|
|
```
|