Cron expression: every 30 seconds

Standard cron runs at most once a minute. Here is how to get a 30-second interval anyway.

Updated

* * * * *
Cron expression
Not possible with one cron line — see below
Schedule

Open in the Cron Expression Generator →

What * * * * * means

Cron reads five fields from left to right: minute, hour, day of the month, month and day of the week. This page shows the closest standard expression (every minute) and how to get a 30-second interval.

FieldValueMeaningAllowed
Minute*every minute0–59
Hour*every hour0–23
Day of month*every day of the month1–31
Month*every month1–12
Day of week*every day of the week0–6 (Sun–Sat)

Next runs

Calculated in your browser for your time zone. On a server, cron uses the server’s time zone (often UTC).

  1. Enable JavaScript to see the next run times.

Typical uses

  • Very frequent polling

Good to know

Standard cron can’t go below one minute. Run a job every minute that runs twice: * * * * * /job.sh; sleep 30; /job.sh, or use a systemd timer (OnCalendar=*:*:0/30) or a long-running worker.

Use it in crontab, GitHub Actions, Kubernetes and Node.js

crontab (crontab -e):

* * * * * /usr/local/bin/my-job.sh >> /var/log/my-job.log 2>&1

GitHub Actions (times are UTC): GitHub Actions runs schedules at most every 5 minutes, so this one would be throttled there.

on:
  schedule:
    - cron: '* * * * *'

Kubernetes CronJob:

apiVersion: batch/v1
kind: CronJob
metadata:
  name: my-job
spec:
  schedule: "* * * * *"
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: OnFailure
          containers:
            - name: my-job
              image: alpine:3
              command: ["sh", "-c", "echo running"]

Node.js (node-cron):

import cron from 'node-cron';
cron.schedule('* * * * *', () => {
  // your job
});

Related schedules

Build your own scheduleTurn any schedule into a cron expression — or any expression into plain English — with the next run times.
Open the Cron Generator

Frequently asked questions

What is the cron expression for every 30 seconds?
Standard cron can’t run more often than once a minute. Use * * * * * with a 30-second sleep, a systemd timer, or a worker process. Standard cron can’t go below one minute. Run a job every minute that runs twice: * * * * * /job.sh; sleep 30; /job.sh, or use a systemd timer (OnCalendar=*:*:0/30) or a long-running worker.
Which time zone does cron use?
Classic cron uses the server’s local time zone, and many servers run in UTC. GitHub Actions always uses UTC. Kubernetes CronJobs use the controller’s time zone unless you set spec.timeZone (for example Europe/Berlin).
How do I test a cron expression?
Paste it into the Cron Expression Generator to see it in plain English with the next run times, then check your job’s log after the first scheduled run.