A cron job that runs every minute can use more CPU and memory than the work it does is worth, and on a busy server many such jobs add up. There are two ways to limit this: a server administrator can enforce a minimum interval for every user's cron jobs, and anyone can make a single job skip runs that come too soon or overlap. This guide shows both with safe bash scripts, and explains what already applies on Domain India shared hosting.
On Domain India cPanel and DirectAdmin shared hosting, a job set to run every 1, 2 or 3 minutes is automatically changed to every 4 minutes, so schedule jobs every 4 minutes or less often. On your own VPS or server, you can enforce a similar rule with a root script that edits user crontabs carefully, but for a single job the better tool is a wrapper that uses flock to stop overlaps and a timestamp file to enforce a minimum gap.
1. Why limit cron frequency
Each cron run starts a new process: often a PHP interpreter, a database connection and your application's start-up code. At every minute, that is 1,440 starts a day per job. Two problems follow:
- Load adds up. On a server with many accounts, hundreds of every-minute jobs start at the same second and cause a spike.
- Runs pile up. If a job takes longer than its interval, the next copy starts before the last one finishes, and several copies compete for the same resources.
Most tasks, such as sending queued mail, clearing caches or running WordPress's scheduled events, work fine every 5 or 15 minutes.
2. What applies on Domain India shared hosting
We checked our servers on 24 September 2026. On our cPanel and DirectAdmin shared servers, an hourly system job looks for user cron jobs scheduled every minute (* * * * *) or every 2 or 3 minutes (*/2 or */3 with the other fields set to *) and changes them to every 4 minutes (*/4 * * * *). In practice:
| Your schedule | What runs on our shared servers |
|---|---|
or /1 | Changed to every 4 minutes |
/2 or /3 | Changed to every 4 minutes |
/4 * or less often | Runs as you set it |
Webuzo was not checked. You can't change this rule on shared hosting, and it covers the whole server. Applications that expect a job every minute, such as Laravel's scheduler, will run it every 4 minutes, so check that your tasks tolerate that. To set up jobs in your control panel, see how to set up a cron job and cron job commands.
Cron jobs also count against your account's CPU, memory and process limits; see understanding hosting resource limits.
3. For a single job: skip runs that come too soon
The simplest and safest way to limit one job is to wrap it. This script runs your command only if no other copy is running and the last successful run was at least a set number of minutes ago:
#!/bin/bash
# cron-guard.sh MIN_MINUTES NAME COMMAND...
# Example: cron-guard.sh 15 sitemap /usr/local/bin/php /home/user/cron/sitemap.php
set -u
min_minutes="$1"; name="$2"; shift 2
state_dir="$HOME/.cron-guard"
mkdir -p "$state_dir"
lock="$state_dir/$name.lock"
stamp="$state_dir/$name.last"
exec 9>"$lock"
flock -n 9 || exit 0 # another copy is still running
if [ -f "$stamp" ]; then
last=$(cat "$stamp")
now=$(date +%s)
if [ $(( now - last )) -lt $(( min_minutes * 60 )) ]; then
exit 0 # too soon since the last run
fi
fi
"$@" && date +%s > "$stamp"Save it in your home folder (for example ~/bin/cron-guard.sh), make it executable with chmod 700 ~/bin/cron-guard.sh, and call it from cron:
*/5 * * * * /home/USERNAME/bin/cron-guard.sh 15 sitemap /usr/local/bin/php /home/USERNAME/cron/sitemap.php >/dev/null 2>&1Cron checks every 5 minutes, but the task runs at most every 15 minutes and never twice at once. The timestamp is written only after a successful run, so a failed run is retried at the next check. If you only need to stop overlaps, flock on its own is enough: /usr/bin/flock -n /home/USERNAME/cron.lock COMMAND.
4. For a server you run: enforce a minimum interval for all users
On your own VPS or server with several users, you may want a server-wide rule like ours. This applies to servers where you have root; on shared hosting you can't do it. A safer version of the classic script:
#!/bin/bash
# /usr/local/sbin/cron-min-interval.sh, run hourly by root
MIN=5 # minimum minutes between runs
LOG=/var/log/cron-min-interval.log
# cronie (AlmaLinux, Rocky) uses /var/spool/cron; Debian and Ubuntu use /var/spool/cron/crontabs
SPOOL=/var/spool/cron
[ -d /var/spool/cron/crontabs ] && SPOOL=/var/spool/cron/crontabs
exec 9>/run/cron-min-interval.lock
flock -n 9 || exit 0
too_often="^(\*|\*/[1-$((MIN - 1))])( \* \* \* \*)"
for tab in "$SPOOL"/*; do
[ -f "$tab" ] || continue
user=$(basename "$tab")
[ "$user" = root ] && continue
if grep -qE "$too_often" "$tab"; then
cp -p "$tab" "/root/crontab-backup-$user-$(date +%F)"
sed -i -E "s#$too_often#*/$MIN\2#" "$tab"
echo "$(date '+%F %T') $user: changed to every $MIN minutes" >> "$LOG"
fi
doneRun it from root's crontab with 0 * * * * /usr/local/sbin/cron-min-interval.sh. Compared with older scripts that do the same job, this version:
- uses one pattern instead of a loop that rewrites the file many times, and works for any minimum from 2 to 10 minutes;
- skips root, so system jobs are never changed;
- backs up each crontab before editing it and logs every change;
- uses a lock, so two copies never edit the same file at once;
- finds the right spool folder on both RHEL-family and Debian-family systems.
It only catches the simple every-N-minutes forms. A schedule such as */2 9-18 * * * or a list of minutes passes unchanged, so treat it as a guard rail, not a complete control.
Editing someone's crontab silently changes how their application behaves. Announce the rule, and on a hosting server put it in your terms. A crontab edited while its owner is saving it with crontab -e can lose one of the two changes, which is another reason to run the script only hourly.
5. Alternatives worth knowing
- systemd timers on your own server can add a random delay (
RandomizedDelaySec) so jobs don't all start at the same second, and they never start a second copy of a unit that is still running. - A queue worker is better than an every-minute cron for work that arrives continuously. On shared hosting a permanent worker isn't possible; the App Platform or a VPS can run one.
cron.allowandcron.denyin/etccontrol which users may use cron at all.
For more on scheduling system tasks, see automating maintenance with cron and anacron.
6. Where Domain India fits
Cron jobs are part of every Domain India cPanel, DirectAdmin and Webuzo shared hosting plan, set up from the control panel. If your application genuinely needs a task every minute or a process that runs all the time, a VPS gives you root access and your own cron and systemd. The cards show Domain India list prices on 19 September 2026, excluding 18% GST.
- 25 GB NVMe SSD Storage
- 50 GB Monthly Bandwidth
- 1 Website
- 10 Email Accounts
- 1 vCPU
- 2 GB DDR4 RAM
- 64 GB NVMe SSD Storage
- 2 TB Monthly Bandwidth
Frequently asked questions
How often can a cron job run on Domain India shared hosting?
At most every 4 minutes on Domain India's cPanel and DirectAdmin shared servers. A job scheduled every 1, 2 or 3 minutes is changed automatically to every 4 minutes by an hourly system check.
Why did my every-minute cron job change to */4?
Domain India's cPanel and DirectAdmin shared servers change user cron jobs that run every 1 to 3 minutes to every 4 minutes, to protect server performance for all accounts. Schedule the job every 4 minutes or less often.
How do I stop a cron job running twice at the same time?
Start it through flock, for example /usr/bin/flock -n /home/username/job.lock followed by your command. If a previous copy still holds the lock, the new run exits immediately.
Can I run a job at most every 15 minutes even if cron checks more often?
Yes. Use a wrapper script that records the time of the last successful run in a file and exits if not enough time has passed, as shown in this guide.
Does Laravel's scheduler work on shared hosting if cron runs every 4 minutes?
The scheduler runs, but only every 4 minutes on Domain India shared servers, so tasks set to run every minute run less often. Some scheduler features also need PHP functions that shared hosting disables. For per-minute scheduling, use a VPS.
Can I enforce a minimum cron interval for users on my own server?
Yes, as root. Run an hourly script that backs up each user's crontab and rewrites schedules that are too frequent, skipping root, as shown in this guide. Tell users about the rule first.
Ready to schedule your jobs? Set them up with how to set up a cron job, compare VPS plans if you need per-minute tasks, or open a support ticket if a job doesn't run.
Tell us the schedule, the command and what should happen, and our team will help you get it running.
Open a ticket