Update Task¶
The tasks update command updates an existing task from inline parameters or a JSON file. Uses TASK_ID if given, otherwise resolves by --name.
Modes¶
| Mode | When to Use |
|---|---|
| Inline | Quick field updates โ pass only the fields to change as CLI flags. |
File (--file) |
Bulk or complex updates โ provide a JSON file with fields to change. |
Both modes are mutually exclusive. If --file is provided, all inline parameters are ignored.
Parameters¶
Identification¶
| Parameter | Description |
|---|---|
TASK_ID |
Task ID (optional positional). Omit to use --name resolution. |
--name, -n |
Task name โ used to look up the task ID when TASK_ID is omitted. Can also update the name itself. |
File Mode¶
| Parameter | Description |
|---|---|
--file, -f |
JSON file with task updates. |
Inline Parameters (all optional โ only provided fields are updated)¶
| Parameter | Description |
|---|---|
--cmd, -c |
Command to run. |
--host |
Agent hostname. |
--description, -d |
Task description. |
--run-as-user |
System user to run the command as. |
--active / --inactive |
Active status. |
--group-id, -g |
Group ID. |
--timezone, -z |
Timezone in IANA format. |
--trigger-times |
Comma-separated times in HH:MM format. Automatically deduplicated and sorted. |
--day-of-week |
7-character binary string for MTWTFSS (e.g. 1111100 = MonโFri). |
--ordinal-day |
Ordinal day description. |
--run-frequency |
Run frequency in HH:MM-HH:MM-freq format. |
--calendar |
Calendar name (must exist in the backend). |
--dependency |
Dependency string (e.g. S:taskname). |
--max-run-time |
Maximum run time in seconds (1โ172800). |
--retry-attempts |
Number of retry attempts on failure. |
--stdout |
File path for stdout capture. |
--stderr |
File path for stderr capture. |
--profile |
Profile name. |
--task-owner |
Task owner. |
Mutual Exclusivity
- Only one of
--trigger-timesor--run-frequencymay be provided (not both). - Only one of
--day-of-weekor--ordinal-daymay be provided (not both).
๐ฅ๏ธ Basic Usage¶
Usage: easytask tasks update [OPTIONS] [TASK_ID]
Update a task from inline parameters or a JSON file. Uses TASK_ID if given,
otherwise looks up by name.
โญโ Arguments โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ task_id INTEGER Task ID (optional if using --name or --file) โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --file -f PATH JSON file with task updates โ
โ --name -n TEXT Task name (also resolves ID if TASK_ID โ
โ is omitted) โ
โ --cmd -c TEXT Command to run โ
โ --host TEXT Agent hostname โ
โ --description -d TEXT Task description โ
โ --run-as-user TEXT Run as user โ
โ --active / --inactive Active status โ
โ --group-id -g INT Group ID โ
โ --timezone -z TEXT Timezone โ
โ --trigger-times TEXT Comma-separated HH:MM โ
โ --day-of-week TEXT 7-char binary MTWTFSS โ
โ --ordinal-day TEXT Ordinal day โ
โ --run-frequency TEXT HH:MM-HH:MM-freq โ
โ --calendar TEXT Calendar name โ
โ --dependency TEXT Dependency string โ
โ --max-run-time INT Max run time in seconds โ
โ --retry-attempts INT Retry attempts โ
โ --stdout TEXT Stdout file path โ
โ --stderr TEXT Stderr file path โ
โ --profile TEXT Profile name โ
โ --task-owner TEXT Task owner โ
โ --help -h Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Inline Mode Examples¶
Update task command by ID¶
Update task by name resolution¶
When you don't know the task ID, use --name to look it up:
Update trigger times (automatically sorted)¶
Deactivate a task¶
Update max run time and retry¶
File Mode Examples¶
Sample Input¶
task_update.json
{
"cmd": "/usr/bin/python3 /scripts/process_v2.py",
"max_run_time": 7200,
"active": true
}