How to Set Up a Cron Job in cPanel

A cron job is a scheduled task that runs automatically on your server at set intervals — for example, sending a daily report, cleaning up temporary files, or triggering a WordPress task.

How to Create a Cron Job in cPanel

  1. Log in to cPanel.
  2. In the Advanced section, click Cron Jobs.
  3. Under Add New Cron Job, choose a schedule using the Common Settings dropdown (e.g., Once Per Day, Once Per Hour) or enter custom values in the Minute, Hour, Day, Month, and Weekday fields.
  4. In the Command field, enter the command to run.
  5. Click Add New Cron Job.

Common Cron Schedule Examples

  • Every 5 minutes: */5 * * * *
  • Every hour: 0 * * * *
  • Every day at midnight: 0 0 * * *
  • Every Monday at 8am: 0 8 * * 1

Example: Running a WordPress WP-Cron Command

WordPress relies on a pseudo-cron called WP-Cron to send emails, publish scheduled posts, and run plugins. For reliability, disable the built-in WP-Cron and use a real cron job instead.

Step 1 — Add this to wp-config.php:

define('DISABLE_WP_CRON', true);

Step 2 — Add this cron job in cPanel (every 5 minutes):

*/5 * * * * php /home/cpanelusername/public_html/wp-cron.php > /dev/null 2>&1

Replace cpanelusername with your actual cPanel username and public_html with the correct path if WordPress is in a subdirectory.

How to Find Your Full Server Path

In cPanel File Manager, navigate to your public_html folder. The full path is shown at the top of the File Manager interface (e.g., /home/myusername/public_html).

Receiving Cron Email Notifications

By default, cPanel emails you the output of every cron job. To silence notifications, append > /dev/null 2>&1 to the end of your command.

Note: If your cron job is not running, double-check the server timezone. Hordanso servers typically run on UTC. Adjust your cron time accordingly if you want it to run at a local Nigerian time.

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Register a Domain in 5 Minutes

Getting online starts with a great domain name. Follow these simple steps to register your domain...

How to Change Nameservers of Your Domain

Changing your domain’s nameservers is essential when pointing your domain to a different hosting...

Uploading Files Using File Manager in cPanel

Uploading your website files is an essential step in going live. With cPanel's File Manager, you...

How to Access cPanel

cPanel is the control panel for your Hordanso shared hosting account. It is where you manage your...

How to Create an Email Account in cPanel

Creating a professional email address for your domain (e.g., [email protected]) takes less...

Powered by WHMCompleteSolution