Skip to content
User guide

Jobs and schedules

Run a script from git on a schedule or on demand: create a job, set its schedule and run options, follow its runs, chain jobs and group them.

A job runs one file from a git repository in its own container, on a schedule or when someone starts it. Exit code 0 means success. Reports, data loads and nightly clean-ups are typical jobs.

Create a job

  1. Open Jobs and click New job (or Create > New job).

  2. Fill in the form:

Field

What to enter

Name (required)

Shown in the jobs table and in alerts

Project (optional)

Linking a job to a project lets it use the project's databases and secrets. You need change rights on the project.

Group (optional)

Jobs in a group share its repository, branch, mount and variables

Repository (required without a group)

An HTTPS or SSH git URL, such as https://bitbucket.org/team/jobs.git

Branch

The branch each run checks out

Folder (optional)

Where the file is; empty means the top of the repository

Entry file (required)

The file the job runs, with its extension, such as main.py or report.R

Arguments (optional)

Separated by spaces, under 100 characters

Size (optional)

The CPU and memory cap of each run

  1. Choose when it runs: on demand only, once at a date and time, or on a repeating schedule (every few minutes or hours, daily, weekly on chosen weekdays, monthly), in your time zone.

  2. Add variables if the code needs them. A value that looks like a password is moved to the Vault as your secret.

  3. Create it. A scheduled job builds now and runs on its schedule; an on-demand job runs when someone starts it.

The Jobs page

Each job shows its schedule in words, on your clock, its last result and its next run. Favourites and Mine sit above the list. Other views: job groups and reports.

One job's page

Tab

What

Overview

Last runs, success rate, next run

Runs

Every run with status, duration and output; open one for its log

Dependencies

Jobs it waits for, and jobs that wait for it

Delivery

Where its outputs go and when they are expected

History

Every change to the job

Settings

General (on or off), schedule, run options, environment variables, alerts and access

Buttons: Run now (always runs, even when the job is paused or off), Stop run while it runs.

Run options

Under Settings > Run options:

  • If the previous run is still going: Skip this run (the default), Queue it, or Replace it. Runs of one job never overlap.

  • Timeout (minutes): the run is stopped after this.

  • Retries on failure: how many times, and how long to wait in between.

  • Market holidays and blackout dates: skip scheduled runs on those days.

  • Pause until a date: scheduled runs stop until then; Run now still works.

Chain jobs

On Dependencies, add the job this one waits for. When that job finishes, this one starts. Automatic runs (schedule, dependency, retry) obey the run options; a person's Run now always runs.

Job groups

A job group is several jobs that share one repository, branch, mount and shared variables. Create the group, then create jobs in it or add existing ones. Group tabs: Overview, Jobs, Shared variables, Mounts, Settings. Secrets are still bound per job.

Keep a job up to date

Under Settings > Auto-update a job rebuilds from its branch on every push (webhook) or on a poll, like a project; see Project settings.

Alerts

Turn on alerts for job failed, run took too long and missed its schedule. They show under Activity > Alerts and reach the channels your organisation set up (in the console, by e-mail or to a webhook).

Download: PDF · Word · Markdown