cPanel
cPanel cron jobs: how to schedule recurring tasks
Published August 2026 · 7 min read
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 and errors during initial deployment so failures remain visible. 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 locking behaviour explicitly.
Next step
Use cPanel cron jobs for recurring commands with the right executable path, working assumptions, frequency, output handling, locking, and resource awareness.
See hosting with cron access