+234 916 042 1899
Sign in

How to Set Up Cron Jobs in cPanel (Step-by-Step Guide)

How to Set Up Cron Jobs in cPanel

How to Set Up Cron Jobs in cPanel (Step-by-Step Guide)

This step-by-step guide shows you exactly how to set up cron jobs in cPanel. If you want your website to run automated tasks like backups, email sending, script execution, or maintenance routines, you need to set up Cron Jobs.

A cron job is simply a scheduled task that your server runs at specific intervals.

What is a Cron Job?

A cron job is an automated command or script that runs on your server at a scheduled time.
You can schedule tasks to run:

  • Every minute

  • Hourly

  • Daily

  • Weekly

  • Monthly

  • At custom intervals

Developers use cron jobs for things like:

  • Running PHP scripts

  • Clearing cache

  • Sending scheduled emails

  • Updating databases

  • Auto-generating reports

  • Triggering backups

If you’re using any script or plugin that requires automation, you’ll likely set up a cron job.

cPanel cron job tutorial

Step 1: Log In to Your cPanel Account

After activating your hosting plan, check your email for your cPanel login details.
Log in, and once you’re inside the dashboard, scroll down to the Advanced section.


Step 2: Find and Click the Cron Jobs Icon

In cPanel, look for the option named:

  • Cron Jobs

  • Cron Manager

  • Scheduled Tasks

Click on it to access your cron settings.


Step 3: Choose the Email Address for Notifications

At the top, you’ll see a field to enter an email address.
This is where cPanel will send notification emails every time your cron job runs.

If you don’t want constant emails, leave this blank or disable notifications later.


Step 4: Set the Timing for Your Cron Job

This is where you choose how often your task should run.

You’ll see settings like:

  • Minute

  • Hour

  • Day

  • Month

  • Weekday

For beginners, cPanel also provides Common Settings such as:

  • Once per minute

  • Twice per hour

  • Once every hour

  • Once per day

  • Once per week

  • Once per month

Choose a preset or manually enter your timing.

Examples:

Every 5 minutes:

*/5 * * * *

Daily at midnight:

0 0 * * *

Every Monday at 3 AM:

0 3 * * 1

Step 5: Enter the Command You Want to Run

This is the most important part.
Your command could be:

A PHP script

/usr/bin/php /home/username/public_html/cron.php

A shell command

wget -q -O - https://yourdomain.com/cron.php >/dev/null 2>&1

A script inside a folder

/usr/bin/php /home/username/public_html/scripts/cleanup.php

Make sure the path to your file is correct.
You can confirm your path by checking your File Manager inside cPanel.


Step 6: Click Add New Cron Job

Once your time settings and command are entered, click the Add New Cron Job button.

Your cron job is now active and will run based on the schedule you set.


How to Verify Your Cron Job Is Working

You can confirm your cron job runs correctly by:

  • Checking the output in your email (if notifications are enabled)

  • Checking the script results (e.g., updated database, new files, logs)

  • Adding simple logging inside your PHP script to track execution

If nothing seems to happen, double-check:

  • File permissions

  • File path

  • Script errors

  • Command accuracy


Tips for Setting Up Cron Jobs Safely

  • Do not run heavy scripts too frequently; it may slow down your website

  • Use logging inside your scripts to monitor errors

  • Disable email notifications if you receive too many alerts

  • Always test your script manually before automating it

  • Keep your cron commands clean and organized

  • Use absolute paths, not relative ones


Common Cron Job Examples for WordPress and PHP

WordPress cron replacement

*/10 * * * * wget -q -O - https://yourdomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

Clear cache script

0 */6 * * * /usr/bin/php /home/user/public_html/clear-cache.php

Auto-backup script

0 0 * * * /usr/bin/php /home/user/backups/backup.php

Final Thoughts

Setting up cron jobs in cPanel is simple once you understand the timing format and script path. Whether you’re automating backups, updating your database, or running scheduled maintenance, cron jobs help keep your website running smoothly without manual effort.

Post Your Comment

Build Your Website with Hosting Nigeria.

We are rated the best web hosting company in Nigeria!