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.
| Command | What it does |
|---|---|
stechbd job ls | Every job, its schedule and when it next runs |
stechbd job create | Schedule a command; everything after -- is its argument list |
stechbd job rm | Delete a job and its run history |
stechbd job runs | A job's recent runs, including the ones that did not happen |
stechbd job logs | What a run printed, when the panel kept its output |
stechbd job run | Run a job now, outside its schedule |
stechbd job cancel | Stop 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.
stechbd job ls [--project <project>]| Option | Description |
|---|---|
--project <project> | Show only the jobs in this project. |
stechbd job ls
stechbd job ls --project blog --jsonstechbd 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.
stechbd job create <name> [--schedule <cron>] [--timeout <seconds>] [--expect-every <seconds>] [--app <app>] -- <command>...| Option | Description |
|---|---|
<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. |
stechbd job create nightly --schedule '0 3 * * *' -- node scripts/backup.js
stechbd job create reindex -- node scripts/reindex.js --full
stechbd job run reindexstechbd 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.
stechbd job rm <job> [--yes]| Option | Description |
|---|---|
<job> | The job, by name or id. Required. |
--yes | Skip the question. |
stechbd job rm nightly
stechbd job rm nightly --yesstechbd 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.
stechbd job runs <job>| Option | Description |
|---|---|
<job> | The job, by name or id. Required. |
stechbd job runs nightly
stechbd job runs nightly --jsonstechbd 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.
stechbd job logs <job> <run>| Option | Description |
|---|---|
<job> | The job, by name or id. Required. |
<run> | The run id, as shown by job runs. Required. |
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.
stechbd job run <job>| Option | Description |
|---|---|
<job> | The job, by name or id. Required. |
stechbd job run nightlystechbd job cancel
Stops a run that has not finished. Only that run is affected.
stechbd job cancel <job> <run>| Option | Description |
|---|---|
<job> | The job, by name or id. Required. |
<run> | The run id, as shown by job runs. Required. |
stechbd job cancel nightly 01J...