Cron Expression
Standard cron cannot fire every 10 seconds. This every-minute entry starts a wrapper that loops with sleep, running your job 6 times per minute — details below.
Cron's smallest interval is one minute. See the loop-based crontab pattern and systemd timer that actually run a job every 10 seconds.
Standard cron cannot fire every 10 seconds. This every-minute entry starts a wrapper that loops with sleep, running your job 6 times per minute — details below.
| Field | Value | Meaning |
|---|---|---|
| Minute | * | Any minute |
| Hour | * | Any hour |
| Day of Month | * | Any day |
| Month | * | Any month |
| Day of Week | * | Any day of the week |
There is no cron expression for every 10 seconds — the 5-field cron format bottoms out at one minute. Anything claiming */10 * * * * * works in your crontab is describing a different scheduler (Quartz and some application frameworks accept 6 fields, but Linux crontab does not).
Here’s how to actually get a 10-second cadence.
Run a wrapper once a minute that executes your job 6 times, 10 seconds apart:
* * * * * /path/to/every-10s.sh
With every-10s.sh:
#!/bin/bash
# 6 runs per minute: at :00, :10, :20, :30, :40, :50
for i in 0 1 2 3 4 5; do
/path/to/your/job.sh &
sleep 10
done
The & backgrounds each run so a slow job doesn’t push later iterations off schedule. If runs must never overlap, drop the & and accept the drift, or use flock.
systemd timers handle sub-minute schedules natively:
[Unit]
Description=Run myjob every 10 seconds
[Timer]
OnBootSec=10
OnUnitActiveSec=10
AccuracySec=1s
[Install]
WantedBy=timers.target
AccuracySec=1s matters — systemd’s default accuracy window is 1 minute, which would defeat the point.
Ten seconds is polling territory. Before shipping this, ask whether the underlying need is really “react quickly to new data” — if so, a persistent worker process, a message queue consumer, or database change notifications will be more efficient and more precise than 6 process spawns per minute. Cron-plus-sleep is fine for prototypes and low-stakes polling; it’s fragile as core infrastructure.
crontab -e)chmod +x every-10s.sh)flock if job runs might overlap