# Run cron jobs

Cron is a [service mode](/docs/services/service-modes) for scheduled work: nightly imports, cleanup jobs, report generation. The container starts on a schedule you set, runs to completion, and takes no HTTP traffic.

## Create a cron job

1. 
2. 
3. 
4. 
5.

While you type, the console reads the schedule back in words and shows a countdown to the next run, so a typo is visible before you deploy.

## The schedule

A cron expression has five fields: minute, hour, day of month, month, day of week.

A schedule is always required in cron mode — through the [API](/api/services), a cron service without one is rejected.

## How runs behave

Once deployed, the service's health shows **Scheduled** — registered and waiting for its next tick. On each tick, Koo starts your container; the run ends when your process exits.

A cron service takes no HTTP traffic and can never be exposed — it has no public URL. If you switch an exposed service to cron mode, its public networking is turned off.

The replica count doesn't apply in cron mode: each tick starts one run in each of the service's locations, and nothing runs between ticks.

## Logs

Each run's output lands in the service's **Logs** tab, like any other service — see [logs](/docs/observability/logs).

## Use variables and databases

[Variables](/docs/configuration/variables) work normally in cron mode, including connection variables — so a cron job can use your database, for example a nightly job that works through rows in Postgres. See [connect a database](/docs/databases/connect-a-database).
