# Cron jobs

> Run a command from your project on a schedule. It uses the same code, variables and database as the service it belongs to. Times are always UTC.

## Add a cron job

```sh
$ 00b5e2 cron add nightly-report --schedule "0 3 * * *" \
    --command "curl -fsS http://api:8080/reports/nightly"
■ nightly-report runs every day at 03:00 UTC in development
# the same with --prod adds it to production
```

## Schedules

| schedule | runs |
| --- | --- |
| `*/15 * * * *` | Every 15 minutes |
| `0 * * * *` | Every hour, on the hour |
| `0 3 * * *` | Every day at 03:00 UTC |
| `0 9 * * 1` | Every Monday at 09:00 UTC |

## Run it now

```sh
$ 00b5e2 cron run nightly-report
run 41 started at 10:20 UTC
■ run 41 finished in 12s
$ 00b5e2 logs nightly-report --run 41
```

## See the runs

```sh
$ 00b5e2 cron ls --json
[ { "name": "nightly-report", "schedule": "0 3 * * *", "env": "development",
    "last_run": "2026-11-23T03:00:00Z", "result": "ok" } ]
```

> A run never starts while the last one is still going. When a run fails, the project gets an alert and the log is kept with the run.

## From an agent

| tool | what it does |
| --- | --- |
| `add_cron` | Add or change a cron job in one environment |
| `run_cron` | Start a run now |
| `list_cron_runs` | Recent runs with result, duration and log |

Previous: [Databases](https://docs.00b5e2.com/databases.md)
Next: [Domains](https://docs.00b5e2.com/domains.md)
