Skip to content

create

Create a new scheduled task

Terminal window
conhive-agent cronjobmanager create

Creates and schedules a new task to be run by the agent’s internal scheduler. Requires defining the task details: a unique name, an optional description, a cron expression (e.g., ”*/10 * * * *” for every 10 minutes) specifying the schedule, and the actual command or task to be executed by the agent. Input is typically provided via a JSON payload using the ‘—json’ flag.

Terminal window
conhive-agent cronjobmanager create [flags]
Terminal window
cj create --json '{"name":"hourly-cleanup","description":"Clean temp files","expression":"0 * * * *","task":"filemanager cleanup /tmp"}'
Terminal window
-h, --help help for create
--json string JSON input (required) (with default values):
{
"name": "",
"color": "#F5A623",
"expression": "*/10 * * * *",
"labels": {},
"protected": false,
"disabled": false,
"icon": "solar:atom-broken",
"task": ""
}
-f, --log-format string Specify the logging format (options: console,
json) (default "text")
-l, --log-level string Define the logging level (options: trace,
debug, info, warn, error, fatal, panic)
(default "info")
-o, --log-to-file Enable logging to a file (default true)
-p, --port int32 Port to run the server on (default 5050)
-w, --workdir string Set the working directory for agent operations
(default: $HOME/.conhive)