How to Create a Cron Job in cPanel
Quick Summary
A cron job runs a command or script automatically at scheduled times. It is commonly used for automation tasks.
Common Uses for Cron Jobs
Cron jobs can be used for:
- Running PHP scripts
- Sending scheduled emails
- Running backups
- Updating applications
- Processing queues
- Running maintenance tasks
- WordPress scheduled tasks
Steps to Create a Cron Job
- Log in to cPanel.
- Search for Cron Jobs.
- Open Cron Jobs.
- Choose the schedule.
- Enter the command.
- Click Add New Cron Job.
Example PHP Cron Command
php /home/username/public_html/script.php
Replace username with your cPanel username.
Common Schedule Examples
Every 5 minutes:
*/5 * * * *
Every hour:
0 * * * *
Every day at midnight:
0 0 * * *
Important
Only create cron jobs you understand.
Too many cron jobs or very frequent cron jobs can increase resource usage.
Common Problems
Problem: Cron does not run.
Solution: Check the command path and file permissions.
Problem: Cron sends too many emails.
Solution: Disable cron email notifications or redirect output.
Problem: Website becomes slow.
Solution: Cron job may be running too often.
Need Help?
Open a support ticket:
