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

  1. Log in to cPanel.
  2. Search for Cron Jobs.
  3. Open Cron Jobs.
  4. Choose the schedule.
  5. Enter the command.
  6. 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:

https://bill.cybrohost.com/submitticket.php

Was this answer helpful? 0 Users Found This Useful (0 Votes)