Running a Job Every 15 Seconds with Cron
Cron cannot schedule below one minute. To run something every 15 seconds, launch one job each minute and stagger four runs with sleep, or use a systemd timer with OnUnitActiveSec=15s. Both give true sub-minute cadence.
The sleep-offset trick
Cron fires once a minute; run the command four times, 15s apart:
* * * * * for i in 0 15 30 45; do (sleep $i; /opt/app/job.sh) & done
The & backgrounds each so the offsets don't stack. Keep the job shorter than 15s.
Cleaner: a systemd timer
Create job.timer with OnUnitActiveSec=15s and OnBootSec=15s, pointing at a job.service. This is the native way to get real 15-second cadence with journald logging.
When you actually need this
Sub-minute polling usually means the wrong tool. Consider a long-running daemon or a message queue instead of hammering cron every 15 seconds.
FAQ
Can cron run every 15 seconds?
Not directly — cron's minimum interval is one minute. Use a per-minute job that sleeps 0/15/30/45 seconds, or a systemd timer with OnUnitActiveSec=15s.
What is the sleep trick for sub-minute cron?
Run the command four times inside one per-minute job, each after a sleep of 0, 15, 30, and 45 seconds, backgrounded so they don't stack.
Is a systemd timer better than cron for 15 seconds?
Yes. A timer with OnUnitActiveSec=15s gives true sub-minute cadence natively and logs to journald, without the sleep hack.