S Technologies's Logo

Color

Green
Teal
Indigo
Blue
Purple
Red
Rose

Mode

Light

job

Schedule commands that run inside an application's image, and read their runs and logs.

A job is a command the panel runs on a schedule inside an application's image, or on demand. Use these commands to create a job, run it now, and see what each run did. Every command also takes --json, --quiet and --help.

CommandWhat it does
stechbd job lsEvery job, its schedule and when it next runs
stechbd job createSchedule a command; everything after -- is its argument list
stechbd job rmDelete a job and its run history
stechbd job runsA job's recent runs, including the ones that did not happen
stechbd job logsWhat a run printed, when the panel kept its output
stechbd job runRun a job now, outside its schedule
stechbd job cancelStop a run that has not finished

stechbd job ls

Lists every job with its schedule and when it next runs. A job with no schedule is shown as manual rather than with an empty cell. Pass --project to show only one project.

bash
stechbd job ls [--project <project>]
OptionDescription
--project <project>Show only the jobs in this project.
bash
stechbd job ls
stechbd job ls --project blog --json

stechbd job create

Creates a job. Everything after -- is the command, one argument each, exactly as typed. The panel runs it without a shell, so quoting follows the argument list, not a shell string. Without --schedule the job is manual and runs only when stechbd job run asks. --app defaults to the application the current directory is linked to.

bash
stechbd job create <name> [--schedule <cron>] [--timeout <seconds>] [--expect-every <seconds>] [--app <app>] -- <command>...
OptionDescription
<name>The name of the job. Required.
<command>...The command and its arguments, after --. Required.
--schedule <cron>When to run, as a cron expression. Omit for a manual job.
--timeout <seconds>A whole number of seconds, at least 1, sent to the panel as the job timeout.
--expect-every <seconds>A whole number of seconds, at least 1, sent to the panel as the expected interval between runs.
--app <app>The application whose image runs the job. Defaults to the linked application. An id, or the slug in the linked project.
bash
stechbd job create nightly --schedule '0 3 * * *' -- node scripts/backup.js
stechbd job create reindex -- node scripts/reindex.js --full
stechbd job run reindex

stechbd job rm

Deletes a job and its run history. At a terminal the command asks first; outside one it refuses, and changes nothing, unless --yes is passed.

bash
stechbd job rm <job> [--yes]
OptionDescription
<job>The job, by name or id. Required.
--yesSkip the question.
bash
stechbd job rm nightly
stechbd job rm nightly --yes

stechbd job runs

Lists a job's recent runs: when each was scheduled, its state, exit code and finish time. Scheduled runs that did not happen are included, and the count of missed runs is shown below the table.

bash
stechbd job runs <job>
OptionDescription
<job>The job, by name or id. Required.
bash
stechbd job runs nightly
stechbd job runs nightly --json

stechbd job logs

Prints what a run wrote, one line per output line. It is available only when the panel kept the output. When a run printed a lot, the newest lines are kept and older ones are dropped, and a warning says so. An empty log means the command printed nothing.

bash
stechbd job logs <job> <run>
OptionDescription
<job>The job, by name or id. Required.
<run>The run id, as shown by job runs. Required.
bash
stechbd job logs nightly 01J...

stechbd job run

Starts a run of a job now, outside its schedule. The run is shown in stechbd job runs like a scheduled one.

bash
stechbd job run <job>
OptionDescription
<job>The job, by name or id. Required.
bash
stechbd job run nightly

stechbd job cancel

Stops a run that has not finished. Only that run is affected.

bash
stechbd job cancel <job> <run>
OptionDescription
<job>The job, by name or id. Required.
<run>The run id, as shown by job runs. Required.
bash
stechbd job cancel nightly 01J...