Every 2 minutes: at :00, :02, :04 … :58 past every hour.
| Runs per day | 720 |
|---|---|
| Runs per week | 5,040 |
| Runs per year (2027) | 262,800 |
| Gap between runs | 2 minutes |
| First and last run of the day | 00:00 and 23:58 |
Next run times
Field by field
| Field | Value | Means |
|---|---|---|
| Minute (0-59) | */2 | every 2 minutes, starting at 0 (:00, :02, :04, :06, :08, :10 … (30 values)) |
| Hour (0-23) | * | every hour |
| Day of month (1-31) | * | every day of the month |
| Month (1-12) | * | every month |
| Day of week (0-7, 0 and 7 = Sunday) | * | every day of the week |
The same schedule on other platforms
| Platform | Write it as | Notes |
|---|---|---|
| Linux crontab | */2 * * * * /path/to/script.sh | Runs in the server's time zone. |
| Kubernetes CronJob | schedule: "*/2 * * * *" | Add timeZone: "Etc/UTC" (or any tz name) under spec; without it, the controller's time zone is used. |
| GitHub Actions | - cron: '*/2 * * * *' | Not allowed as written: GitHub's shortest schedule interval is 5 minutes. |
| Jenkins | cron('*/2 * * * *') | Same five fields. Jenkins recommends H to spread load: H/2 * * * * runs at the same rate but at a minute picked from the job name. |
| Quartz | 0 0/2 * * * ? | Seconds come first; one of the two day fields must be ?. |
| AWS EventBridge | cron(0/2 * * * ? *) | Six fields, year last; one day field must be ?. |
| Spring @Scheduled | @Scheduled(cron = "0 */2 * * * *") | Seconds come first. |
| Azure Functions | 0 */2 * * * * | Seconds come first. Runs in UTC unless the app setting WEBSITE_TIME_ZONE is set. |
| systemd timer | OnCalendar=*-*-* *:00/2:00 | Checked with systemd-analyze calendar. |
Schedulers also differ in day-of-week numbering, time zones, special characters like L and ?, and what happens when the clocks change. Every one is compared, with links to its official docs, in the cron dialect registry.
Watch out for
Too frequent for GitHub Actions
GitHub's shortest schedule interval is 5 minutes, so this won't run as written there. Use */5 * * * * or move the job to a server or Kubernetes.
Start it at a different minute
*/2 always counts from minute :00. To shift the whole schedule, give the step a starting point with a range:
| Expression | Fires at |
|---|---|
*/2 * * * * | :00, :02, :04, :06, :08, :10 … |
1-59/2 * * * * | :01, :03, :05, :07, :09, :11 … |
Write 1-59/2, not 1/2. Debian/Ubuntu cron and cronie both reject 1/2 ("bad minute"), even though Quartz and Kubernetes accept it.
Common mistakes
A step can't be larger than its field. Writing */90 for "every 90 minutes" installs on Debian/Ubuntu with only a warning (Step size 90 higher than possible maximum of 59) and then runs once an hour, at :00.
The count also restarts every hour at :00: it is not measured from when you saved the crontab or from the last run. To run a fixed time after the previous run, see the systemd option below.
Every 2 minutes after the last run (systemd)
cron only knows clock times. If you need a gap measured from the previous run, a systemd timer can do it:
[Timer] OnBootSec=5min OnUnitActiveSec=2min AccuracySec=1s
OnUnitActiveSec= counts from when the job last started; OnUnitInactiveSec= counts from when it last finished. Set AccuracySec=: the default of 1 minute lets systemd fire up to a minute late to save wake-ups.
If a run can take longer than the gap
Unix cron doesn't check whether the previous run has finished before starting the next one. Wrap the command in flock -n so a new run gives up immediately (exit status 1) while the old one holds the lock:
*/2 * * * * flock -n /tmp/myjob.lock /path/to/script.sh
flock comes from util-linux.
Can cron run every 30 seconds?
No: a minute is the smallest unit cron understands. Two common workarounds:
* * * * * /path/to/script.sh * * * * * sleep 30; /path/to/script.sh
or a systemd timer with OnUnitActiveSec=30s and AccuracySec=1s (without the accuracy setting, systemd may fire up to a minute late).
Related schedules
* * * * *: Every minute*/10 * * * *: Every 10 minutes*/15 * * * *: Every 15 minutes*/20 * * * *: Every 20 minutes*/30 * * * *: Every 30 minutes*/45 * * * *: Every 45 minutes (not really)
Step-by-step guide: How to run a cron job every 5 minutes. All schedules: common cron expressions. Checking a whole crontab file? Use the crontab checker.
Sources
Run times were checked against an independent cron library (croniter) and this site's engine; every platform version above was parsed and compared run-for-run, and the systemd line was checked with systemd-analyze calendar. Last verified 18 November 2026.
- Debian crontab(5): fields, day-of-month OR day-of-week rule
- Quartz CronTrigger tutorial
- AWS EventBridge: cron expressions
- Spring CronExpression (javadoc)
- Azure Functions timer trigger: NCRONTAB
- Kubernetes CronJob
- GitHub Actions: schedule event
- Jenkins Pipeline syntax: triggers / cron
- systemd.time(7): calendar events
- systemd.timer(5): OnCalendar, OnUnitActiveSec, AccuracySec, RandomizedDelaySec
- flock(1): util-linux
- cronie crontab(5): step values, ~ random ranges, RANDOM_DELAY
- Debian cron entry.c: step larger than the range