Command line

Every schedr command, generated from the code (schedr <command> --help shows the same).

Options of every command

Argument

Description

--config <PATH>

The configuration file (otherwise SCHEDR_CONFIG_FILE, then /etc/schedr/config.toml)

schedr master

Run the master: scheduling loop, state in the database, internal API for workers

schedr master [OPTIONS]

Argument

Description

--migrate

Migrate the database at start, holding the master’s lease, when its schema isn’t up to date, instead of refusing it: for a deployment that can’t migrate as a step of its own (e.g. an init container without a mesh’s sidecar)

schedr worker

Run a worker agent

schedr worker [OPTIONS]

schedr webserver

Run the webserver: the REST API used by the web UI and the CLI

schedr webserver [OPTIONS]

schedr ui

Run the web UI over webservers’ APIs ([ui] deployments)

schedr ui [OPTIONS]

schedr standalone

Run every role in one process (SQLite or Postgres): local development, or one pod in production

schedr standalone [OPTIONS]

Argument

Description

--listen <ADDRESS>

The address the REST API listens on (default 127.0.0.1); e.g. 0.0.0.0 in a pod behind a Service. The master’s gRPC stays on loopback

--migrate

Migrate the database at start (as schedr db migrate does) instead of refusing a schema that isn’t up to date: for a laptop. In production, migrate as a step of its own (the Helm chart’s init container)

--no-ui

Serve only the API on its port, not the web UI: one deployment of a schedr ui elsewhere (a federation of standalones)

--dag-path <PATH>

A folder of DAG files, repeated for more; . is the working folder. Given, these are the DAG roots instead of SCHEDR_DAG_PATH and [dags] path, each named after its folder

--script-path <PATH>

A folder of scripts, repeated for more; . is the working folder. Given, these are the script roots instead of SCHEDR_SCRIPT_PATH and [scripts] path

schedr db

Manage the database schema

schedr db [OPTIONS] <COMMAND>

schedr db migrate

Apply the migrations not applied yet, holding the master’s lease (refused while a master holds it)

schedr db migrate [OPTIONS]

Argument

Description

--wait

Wait until no master holds the lease (one stopped, or dead and its lease expiring) instead of refusing

schedr db status

Show whether the schema fits this version of schedr

schedr db status [OPTIONS]

schedr secrets

Set, list, read and export the secrets of standalone’s db storage (straight in the database, as db is; values encrypted under SCHEDR_SECRET_KEY)

schedr secrets [OPTIONS] <COMMAND>

schedr secrets set

Set keys of the secret at PATH (made if there is none); its other keys are kept

schedr secrets set [OPTIONS] <PATH> <KEY=VALUE>...

Argument

Description

<PATH>

The secret’s path, e.g. etl/db

<KEY=VALUE>

key=value; key=@FILE for a file’s content (exactly), key=- for standard input (one trailing newline dropped). A value starting with @ is set with -

schedr secrets list

List the secrets’ paths and key names (never the values)

schedr secrets list [OPTIONS] [PREFIX]

Argument

Description

<PREFIX>

Only the paths starting with it, e.g. etl/

schedr secrets get

Print one value (path#key), or a whole secret as a JSON object (path)

schedr secrets get [OPTIONS] <SECRET>

Argument

Description

<SECRET>

path#key or path

schedr secrets delete

Delete the secret at PATH, all its keys

schedr secrets delete [OPTIONS] <PATH>

Argument

Description

<PATH>

The secret’s path

schedr secrets export

Write every secret for Vault: DIR/<path>.json each (mode 0600), loaded with vault kv put secret/<path> @DIR/<path>.json. DIR must be empty or missing

schedr secrets export [OPTIONS] --to <DIR>

Argument

Description

--to <DIR>

The directory to write (made if missing)

schedr secrets new-key

Print a new random key for SCHEDR_SECRET_KEY

schedr secrets new-key [OPTIONS]

schedr dags

List, pause, check and test DAGs

schedr dags [OPTIONS] <COMMAND>

schedr dags list

List DAGs

schedr dags list [OPTIONS]

schedr dags pause

Stop the scheduler creating runs of a DAG

schedr dags pause [OPTIONS] <DAG>

Argument

Description

<DAG>

The DAG’s ID

schedr dags unpause

Let the scheduler create runs of a DAG again

schedr dags unpause [OPTIONS] <DAG>

Argument

Description

<DAG>

The DAG’s ID

schedr dags check

Parse DAG files and schedr.toml files locally and report errors

schedr dags check [OPTIONS] <PATH>

Argument

Description

<PATH>

A file or directory

--against <SERVER_URL>

Fail if an active worker at this server runs an older schedr (major.minor) than this one

schedr dags test

Run one real run of a DAG locally and report each task (no server)

schedr dags test [OPTIONS] <DAG>

Argument

Description

<DAG>

The DAG’s ID

--for <TIME>

The moment the run is for (UTC without an offset)

-p, --param <FIELD>

A run parameter: key=value or key:=json

--params <JSON>

All run parameters as one JSON object

--secret <SECRET>

A secret value for the run: path#key=value

--event-key <KEY>

For a DAG a trigger starts: the event’s key

--event-data <JSON>

And its data: JSON, or @file.json

--event-at <TIME>

And when it happened (as --for); the run’s moment otherwise

--connection <CONNECTION>

A connection’s values for the run, given instead of its own: name={"param": value} (stored JSON); its function runs with them

--task <TASK_ID>

Run only this task and its upstream tasks

--path <PATH>

The DAG files: a directory (a DAG root) or one file; default: the configured DAG roots (SCHEDR_DAG_PATH), else the current directory

schedr runs

Trigger, list, show, cancel and backfill runs

schedr runs [OPTIONS] <COMMAND>

schedr runs trigger

Trigger a manual run

schedr runs trigger [OPTIONS] <DAG>

Argument

Description

<DAG>

The DAG’s ID

--for <TIME>

The moment the run is for (UTC without an offset); default: now

-p, --param <FIELD>

A run parameter: key=value or key:=json

--params <JSON>

All run parameters as one JSON object

--event <KEY>

For a DAG a trigger starts: run again an event it found, by key

--event-key <KEY>

Or give an event: its key. It is never stored as an event

--event-data <JSON>

And its data: JSON, or @file.json

--event-at <TIME>

And when it happened (as --for); the run’s moment otherwise

schedr runs list

List the runs of a DAG

schedr runs list [OPTIONS] <DAG>

Argument

Description

<DAG>

The DAG’s ID

--for <TIME>

Only the runs for this moment

schedr runs show

Show a run and its tasks (a mapped task’s instances as fetch[0], fetch[1], …)

schedr runs show [OPTIONS] <RUN_ID>

Argument

Description

<RUN_ID>

The run’s ID

schedr runs cancel

Cancel a run, or what’s left of a backfill

schedr runs cancel [OPTIONS] <RUN_ID|--backfill <BACKFILL_ID>>

Argument

Description

<RUN_ID>

The run’s ID

--backfill <BACKFILL_ID>

Cancel the remaining runs of this backfill instead

schedr runs backfill

Create one run per fire time in a range

schedr runs backfill [OPTIONS] --from <TIME> <DAG>

Argument

Description

<DAG>

The DAG’s ID

--from <TIME>

The range’s first moment (inclusive; UTC without an offset)

--to <TIME>

Its last moment (inclusive); default: now, and a later one ends at now

--all

A run for every fire time, also those with a successful, queued or running run

-p, --param <FIELD>

A run parameter, for every run: key=value or key:=json

--params <JSON>

All run parameters as one JSON object

--dry-run

Only count the fire times and the runs it would create

schedr tasks

Cancel or retry single tasks of a run, or read their attempts, logs and outputs

schedr tasks [OPTIONS] <COMMAND>

schedr tasks cancel

Cancel one running task

schedr tasks cancel [OPTIONS] <RUN_ID> <TASK_ID>

Argument

Description

<RUN_ID>

The run’s ID

<TASK_ID>

The task’s ID

--map-index <N>

The instance of a mapped task

schedr tasks retry

Retry an unschedulable task of an unfinished run

schedr tasks retry [OPTIONS] <RUN_ID> <TASK_ID>

Argument

Description

<RUN_ID>

The run’s ID

<TASK_ID>

The task’s ID

--map-index <N>

The instance of a mapped task

schedr tasks logs

Print an attempt’s log, read from the worker that ran it

schedr tasks logs [OPTIONS] <RUN_ID> <TASK_ID>

Argument

Description

<RUN_ID>

The run’s ID

<TASK_ID>

The task’s ID

--map-index <N>

The instance of a mapped task

--try <N>

The attempt’s try number (the latest by default)

-f, --follow

Keep printing the log while the task runs

schedr tasks attempts

List a task’s attempts (of one instance, for a mapped task)

schedr tasks attempts [OPTIONS] <RUN_ID> <TASK_ID>

Argument

Description

<RUN_ID>

The run’s ID

<TASK_ID>

The task’s ID

--map-index <N>

The instance of a mapped task

schedr tasks output

Print a task’s output (a mapped task’s gathered list, or one instance’s)

schedr tasks output [OPTIONS] <RUN_ID> <TASK_ID>

Argument

Description

<RUN_ID>

The run’s ID

<TASK_ID>

The task’s ID

--map-index <N>

The instance of a mapped task

schedr connections

Check a deployment’s connections, or test one, on a worker

schedr connections [OPTIONS] <COMMAND>

schedr connections check

Render every connection of a root (all roots if none is given) with the worker’s storages: each secret present or missing, never a value. Fails when one isn’t

schedr connections check [OPTIONS] [ROOT]

Argument

Description

<ROOT>

The root; every root with connections if not given

--name <NAME>

Only this connection

--worker <WORKER>

The worker to run it on; one having the root’s current code otherwise

schedr connections test

Open a connection on a worker and run its check (or open and close it, without one). Fails when it doesn’t work

schedr connections test [OPTIONS] <NAME>

Argument

Description

<NAME>

The connection

--root <ROOT>

Its root, when several define one by that name

--worker <WORKER>

The worker to run it on; one having the root’s current code otherwise

--timeout <TIMEOUT>

How long it may take (30s, 2m); [webserver] connection_test_timeout if not given

schedr sensors

Wait steps switched off for getting their host killed

schedr sensors [OPTIONS] <COMMAND>

schedr sensors switched-off

List the wait steps switched off

schedr sensors switched-off [OPTIONS]

schedr sensors switch-on

Switch a wait step back on, forgetting its strikes

schedr sensors switch-on [OPTIONS] <DAG> <SENSOR>

Argument

Description

<DAG>

Its DAG

<SENSOR>

The wait step’s task ID

schedr triggers

Event triggers: see them, and start them again

schedr triggers [OPTIONS] <COMMAND>

schedr triggers list

List every DAG’s trigger

schedr triggers list [OPTIONS]

schedr triggers show

Show a DAG’s trigger

schedr triggers show [OPTIONS] <DAG>

Argument

Description

<DAG>

Its DAG

schedr triggers events

List what a DAG’s trigger found, newest first

schedr triggers events [OPTIONS] <DAG>

Argument

Description

<DAG>

Its DAG

--limit <LIMIT>

How many at most Default: 50.

schedr triggers restart

Start a DAG’s trigger again from its bookmark, whatever stopped it

schedr triggers restart [OPTIONS] <DAG>

Argument

Description

<DAG>

Its DAG

schedr triggers skip

Pass the run an @trigger(wait_for=...) keeps failing on: it is called for the next

schedr triggers skip [OPTIONS] <DAG>

Argument

Description

<DAG>

Its DAG

schedr triggers switch-on

Switch a DAG’s trigger back on, forgetting its strikes

schedr triggers switch-on [OPTIONS] <DAG>

Argument

Description

<DAG>

Its DAG

schedr events

Events posted for EventNamed triggers and waiting steps (decision 354)

schedr events [OPTIONS] <COMMAND>

schedr events post

Post an event: a trigger on its name starts a run per key, a step waiting for it in a run goes on

schedr events post [OPTIONS] --key <KEY> <NAME>

Argument

Description

<NAME>

Its name, written as a DAG ID is

--key <KEY>

Its key

--data <JSON>

Its data: JSON, or @file.json

--at <TIME>

When it happened (UTC without an offset); now otherwise

schedr events list

List the events posted, newest first

schedr events list [OPTIONS]

Argument

Description

--name <NAME>

Only those of this name

--limit <LIMIT>

How many at most Default: 50.

schedr resources

A run’s resources

schedr resources [OPTIONS] <COMMAND>

schedr resources list

List a run’s resources

schedr resources list [OPTIONS] <RUN>

Argument

Description

<RUN>

The run

schedr workers

Drain and resume workers

schedr workers [OPTIONS] <COMMAND>

schedr workers list

List the workers the master has seen, with their state (gone ones included)

schedr workers list [OPTIONS]

schedr workers drain

Drain a worker for maintenance: it finishes its tasks and stays idle

schedr workers drain [OPTIONS] <WORKER>

Argument

Description

<WORKER>

The worker’s ID

schedr workers resume

Let a drained worker take tasks again

schedr workers resume [OPTIONS] <WORKER>

Argument

Description

<WORKER>

The worker’s ID

schedr task-ctx

Inside a running task: cleanup handles, resource values, declared secrets

schedr task-ctx [OPTIONS] <COMMAND>

schedr task-ctx cleanup

Cleanup handles of the running attempt

schedr task-ctx cleanup [OPTIONS] <COMMAND>

schedr task-ctx cleanup add

Register a handle (key=value, key:=json), before the work it cleans up after

schedr task-ctx cleanup add [OPTIONS] <HANDLE_TYPE> [FIELDS]...

Argument

Description

<HANDLE_TYPE>

The handle’s type name, e.g. ExportJob

<FIELDS>

The handle’s fields

--json <JSON>

The whole handle as one JSON object

schedr task-ctx cleanup list

List the handles, in a cleanup

schedr task-ctx cleanup list [OPTIONS] [HANDLE_TYPE]

Argument

Description

<HANDLE_TYPE>

Only handles of this type

--field <NAME>

Print this field’s raw values, one per line

schedr task-ctx resource

The value of the resource this setup creates, or this cleanup cleans up

schedr task-ctx resource [OPTIONS] <COMMAND>

schedr task-ctx resource set

Report the resource’s value, in its setup

schedr task-ctx resource set [OPTIONS] [FIELDS]...

Argument

Description

<FIELDS>

The value’s fields (key=value, key:=json)

--json <JSON>

The whole value as JSON, of any type (--json 7)

schedr task-ctx resource get

Read the resource’s value, in its cleanup

schedr task-ctx resource get [OPTIONS]

Argument

Description

--field <NAME>

Print this field’s raw values, one per line

schedr task-ctx secret

Secrets declared in the task’s secrets=

schedr task-ctx secret [OPTIONS] <COMMAND>

schedr task-ctx secret get

Print a declared secret: a key’s value as it is, with no trailing newline; a whole secret (path without #key) as one line of JSON

schedr task-ctx secret get [OPTIONS] <SECRET>

Argument

Description

<SECRET>

path#key, or path for the whole secret

--storage <NAME>

The secret storage, if not the default one

schedr task-ctx connection

A connection the task declares (connections=): its values, its secrets filled in

schedr task-ctx connection [OPTIONS] <NAME>

Argument

Description

<NAME>

The connection’s name (its function’s)

--env <PREFIX>

Print export PREFIX_PARAM='value' lines for eval, one per parameter (the parameter’s name in capitals; a value that isn’t text as JSON)

--json

Print the values as one line of JSON (the default)

schedr task-ctx api

A request to schedr’s REST API, made as this task (open to tasks: POST and GET /api/v1/events); prints the answer’s JSON, fails on an error status

schedr task-ctx api [OPTIONS] <METHOD> <PATH>

Argument

Description

<METHOD>

GET, POST, …

<PATH>

The path and its query, e.g. /api/v1/events?name=paid

--data <JSON>

The body, JSON

--idempotency-key <KEY>

Sent again with the same key, the request is the one made the first time

schedr task-ctx events

Events (EventNamed), posted and listed as this task

schedr task-ctx events [OPTIONS] <COMMAND>

schedr task-ctx events post

Post an event; prints it as stored, as one line of JSON

schedr task-ctx events post [OPTIONS] --key <KEY> <NAME>

Argument

Description

<NAME>

Its name, written as a DAG ID is

--key <KEY>

Its key: a trigger starts one run per key, a waiting step matches its own

--data <JSON>

Its data: JSON, or @file.json

--at <TIME>

When it happened (UTC without an offset); now otherwise

--idempotency-key <KEY>

Sent again with the same key (a retried task), it is the event stored the first time

schedr task-ctx events list

List the events posted, newest first, one line of JSON each

schedr task-ctx events list [OPTIONS]

Argument

Description

--name <NAME>

Only those of this name

--limit <LIMIT>

How many at most (500 at most) Default: 50.

schedr task-ctx notify

Sends a message to a notification channel of the task’s DAG (or a server one); the master fills the channel’s body and delivers it later

schedr task-ctx notify [OPTIONS] <CHANNEL>

Argument

Description

<CHANNEL>

The channel’s name

--text <TEXT>

Its text (the text placeholder; schedr’s summary otherwise)

--data <JSON>

Its data (the data placeholder): JSON, or @file.json

schedr dag-ctx

Inside a running task: the run’s parameters and run information

schedr dag-ctx [OPTIONS] <COMMAND>

schedr dag-ctx params

The run’s parameters

schedr dag-ctx params [OPTIONS] <COMMAND>

schedr dag-ctx params get

Print the values as JSON, or one field’s raw value

schedr dag-ctx params get [OPTIONS]

Argument

Description

--field <NAME>

Print this field’s raw values, one per line

schedr dag-ctx run

The run information (id, kind, planned_for, since, …)

schedr dag-ctx run [OPTIONS] <COMMAND>

schedr dag-ctx run get

Print the values as JSON, or one field’s raw value

schedr dag-ctx run get [OPTIONS]

Argument

Description

--field <NAME>

Print this field’s raw values, one per line