cPanel

cPanel cron jobs: how to schedule recurring tasks

A cron job runs a command on a schedule without someone opening the website. That makes it useful for queues, cleanup, reports, application schedulers, imports, and backups—but also capable of repeating a bad command every minute.

Use absolute paths and test the command manually

Cron has a smaller environment than an interactive shell. Use explicit executable and file paths where practical, and confirm the command completes successfully under the account before scheduling it.

Choose a frequency the job can finish inside

A job scheduled every five minutes should not normally take ten minutes to run. Overlapping copies can multiply CPU, memory, I/O, database connections, and external API calls.

Make failures observable

Capture useful output or errors rather than redirecting everything to nowhere during initial deployment. Once a job is stable, route logs or notifications somewhere that will still surface failures.

Add locking when duplicate execution is unsafe

Imports, billing tasks, queue workers, and other state-changing jobs may need a lock so a second run cannot start before the first finishes. The application should define that behaviour rather than relying only on wishful scheduling.

Related DotMoose serviceSee hosting with cron access

Keep reading

Related guides.

More cpanel →