Cron Job

Scheduled task that runs on a cron schedule with no persistent process.

What this demonstrates

  • The `schedule` field defines a cron expression
  • `restart: no` means the process runs once and exits
  • No `provides` — cron jobs aren't servers, they don't expose ports

When to use this: Periodic tasks like backups, cleanup scripts, report generation.

Other Fields
cron-job.yaml View on GitHub
# yaml-language-server: $schema=../schema/launchfile.schema.json
version: launch/v1
name: daily-sync
runtime: node
schedule: "0 0 * * *"
restart: "no"
requires:
  - type: postgres
    set_env:
      DATABASE_URL: $url
commands:
  start: "node scripts/sync.js"

Key lines explained

schedule:
Standard cron syntax. This job runs once daily at midnight.
restart: no
The process exits after each run — the scheduler handles re-invocation.
esc
Type to search the docs