---
title: Schedule a job
description: Run a container on a cron schedule, or once, with limits on restarts and duration.
---

A [job](/concepts/components#jobs) runs a container until it exits: a nightly report, a cleanup, a data import.

1. **Create the job**

    In your environment, create a job and name it.

2. **Choose when it runs**

    Choose **Cron** and enter a schedule in the five-field cron syntax, with an optional time zone (UTC by default). Or choose **One-time** to run it once, when it is deployed.

3. **Set the container**

    Enter the image and tag, and optionally the entrypoint and arguments.

4. **Set the limits**

    Set its CPU and memory, then:
    - the maximum number of restarts before the run counts as failed (`0` allows none);
    - the maximum duration, in seconds, after which Kapten stops it and marks it failed.

5. **Create it**

    Review and create the job. Each execution is a run with its own status and logs.

## Cron examples

| Schedule | Runs |
| --- | --- |
| `0 * * * *` | Every hour, on the hour |
| `*/15 * * * *` | Every 15 minutes |
| `30 2 * * *` | Every day at 02:30 |
| `0 9 * * 1` | Every Monday at 09:00 |
| `0 0 1 * *` | On the first day of every month, at midnight |

Seconds are not supported.

> **Tip**
>
> To run database migrations before deploying a new version of your application, make the migration a one-time job and put it in the first stage of a [pipeline](/guides/build-a-pipeline).
