Run a job on a cron schedule
Run a job on a cron schedule
Scheduled jobs differ on every platform. GitHub and GitLab express schedules in YAML; CircleCI and Bitbucket configure them in the UI (Bitbucket) or as a separate workflow trigger (CircleCI).
Conversion notes
- •Bitbucket schedules are configured at Pipelines → Schedules in the repository UI — they cannot be expressed in bitbucket-pipelines.yml.
Side-by-side implementation
name: nightly
on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch: {}
jobs:
job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: ./scripts/nightly.sh
# Configure the schedule in CI/CD → Schedules; this job runs on the schedule trigger.
nightly:
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
script:
- ./scripts/nightly.sh
version: 2.1
jobs:
nightly:
docker: [{ image: cimg/base:stable }]
steps:
- checkout
- run: ./scripts/nightly.sh
workflows:
nightly:
triggers:
- schedule:
cron: '0 3 * * *'
filters:
branches:
only: [main]
jobs: [nightly]
# Bitbucket schedules are configured at Pipelines → Schedules in the repo UI.
image: ubuntu:22.04
pipelines:
custom:
nightly:
- step:
name: nightly
script:
- ./scripts/nightly.sh
Related Tools
YAML Formatter
Format and validate YAML. Convert YAML to JSON or JSON to YAML. Supports 2 and 4 space indentation.
Cron Builder
Visual builder for cron-job schedules.
Gitignore Generator
Generate .gitignore files for any language, framework, or IDE — 100+ templates, 100% client-side.
JSON Schema Generator
Generate a JSON Schema from one or more sample JSONs — drafts 2020-12, 2019-09, 7, 6, 4. Detects formats (date-time, email, uuid, ipv4, uri), extracts $defs, validates with AJV, and exports to YAML, TypeScript, and Zod. 100% in your browser.
AI Coding Rules
Curated rules-file library and generator for Cursor, Claude Code, GitHub Copilot, Windsurf, Cline, Aider, Continue, and Cody. Browse 20 hand-crafted .cursorrules / CLAUDE.md / copilot-instructions.md files for popular stacks, build a custom one with the wizard, or convert any rules file between AI-tool formats.