How to Set Up Cron Jobs in cPanel

Cron jobs allow you to schedule commands or scripts to run automatically at specific intervals. Common uses include sending scheduled emails, generating reports, cleaning up temporary files, or running WordPress maintenance tasks. dotCanada's cPanel makes it easy to set these up.

Creating a Cron Job

  1. Log in to cPanel and go to the Advanced section.
  2. Click Cron Jobs.
  3. Set the frequency using the Common Settings dropdown for quick options like every hour, every day, or every week - or enter a custom schedule manually.
  4. Enter the Command you want to run. For PHP scripts, use the full path to PHP, for example: /usr/bin/php /home/username/public_html/script.php
  5. Click Add New Cron Job.

Cron Schedule Format

The cron schedule uses five fields in this order:

  • Minute (0–59)
  • Hour (0–23)
  • Day of Month (1–31)
  • Month (1–12)
  • Day of Week (0–7, where 0 and 7 are Sunday)

For example, 0 2 * * * runs a job every day at 2:00 AM. An asterisk (*) means every possible value for that field.

Tips

  • Use absolute file paths in your cron commands to avoid errors.
  • Redirect output to a log file to capture errors: append > /home/username/cron.log 2>&1 to your command.
  • Avoid scheduling cron jobs too frequently (e.g., every minute) unless necessary, as this can impact server performance.
  • You can email cron output to yourself by setting the Cron Email field at the top of the Cron Jobs page.

If you need help figuring out the right schedule or command syntax, contact our support team.

100% Satisfaction Guarantee

We're so confident you'll love dotCanada that we offer a 30-day money-back guarantee. Not satisfied? Get a full refund, no questions asked.

Ready to Get Started?

Join thousands of Canadian website owners who trust dotCanada for reliable, fast web hosting.

Get Started Today