Jobs
Recurring jobs
Run a task on a cron schedule.
jobs.scheduledTasks maps cron patterns to task names. Each tick of the clock queues the next run of each entry:
tenon.config.ts
jobs: {
tasks: { "send-digest": digest },
scheduledTasks: { "0 3 * * *": ["send-digest"] },
},
Patterns
- A pattern MUST have five fields: minute, hour, day of month, month and day of week. Seconds and names like
@dailythrow at startup, like an unknown task. - Times are server time, in the time zone of the process. Set
TZon the host if you mean another zone. - The clock MUST tick at least as often as the pattern fires.
How runs behave
- A scheduled run gets one attempt. The next run is its retry.
- A missed run runs once. When the server was down, the run that was queued runs on the next tick, and the runs in between are skipped.
- A new entry starts with the next run after the first tick. It does not run for a time in the past.
- Each entry keeps only its last run, done or failed.
- When you remove an entry, the next tick deletes its runs.
The Cron tab of the Jobs page lists each entry with its next and last run.