---
title: kapacitor flux task update
description: The kapacitor flux task update command updates a Kapacitor Flux task using a specified file or stdin.
url: https://docs.influxdata.com/kapacitor/v1/reference/cli/kapacitor/flux/task/update/
estimated_tokens: 439
product: Kapacitor
version: v1
publisher: InfluxData
canonical: https://docs.influxdata.com/kapacitor/v1/reference/cli/kapacitor/flux/task/update/
date: '2023-10-03T10:49:57-06:00'
lastmod: '2023-10-03T10:49:57-06:00'
---

The `kapacitor flux task update` command updates a Kapacitor Flux task using a
specified file or *stdin*.

## Usage

```sh
kapacitor flux task update [flags] [flux-script]
```

## Arguments

* **flux-script**: Flux script provided via *stdin* (`-`).

## Flags

|Flag|          |                   Description                   |
|----|----------|-------------------------------------------------|
|`-f`| `--file` |            Path to Flux script file             |
|`-h`| `--help` |                Show command help                |
|`-i`|  `--id`  |             Required: Flux task ID              |
|    | `--json` |               Output data as JSON               |
|    |`--status`|Update the task’s status (`active` or `inactive`)|

## Examples

* [Update Flux task code using a file](#update-flux-task-code-using-a-file)
* [Update Flux task code via stdin](#update-flux-task-code-via-stdin)
* [Enable or disable a Flux task](#enable-or-disable-a-flux-task)

### Update Flux task code using a file

```sh
kapacitor flux task update \
  --id 000x00xX0xXXx00 \
  --file /path/to/updated-task.flux
```

### Update Flux task code via stdin

```sh
kapacitor flux task update --id 000x00xX0xXXx00 -
# Enter the Flux script in the stdin prompt
```

### Enable or disable a Flux task

```sh
kapacitor flux task update \
  --id 000x00xX0xXXx00 \
  --status inactive
```

#### Related

* [Update Kapacitor Flux tasks](/kapacitor/v1/working/flux/manage/update/)
| Flag |  | Description |
| --- | --- | --- |
| Flag |  | Description |
| -f | --file | Path to Flux script file |
| -h | --help | Show command help |
| -i | --id | Required : Flux task ID |
|  | --json | Output data as JSON |
|  | --status | Update the task’s status ( active  or  inactive ) |
