Print

How to Set Up and Manage Cron Jobs in cPanel (Automate Website Tasks Easily)

Tired of doing the same tasks over and over? Want to automate scripts like backups, database cleanups, or email reports? You can do all that with cron jobs — and cPanel makes it simple to manage them.

In this guide, you’ll learn how to set up and manage cron jobs in cPanel, along with examples of common cron tasks.


✅ What Is a Cron Job?

A cron job is a scheduled task that runs automatically at specific intervals. It tells your server to execute a command or script — like:

  • Sending automated email reports
  • Running backups
  • Clearing cache or logs
  • Triggering scheduled tasks in WordPress or other CMS

Think of it as your website’s built-in automation tool.


🚀 How to Set Up a Cron Job in cPanel

Step 1: Log in to cPanel

Access your account through yourdomain.com:2083 or your hosting dashboard.

Step 2: Find the Cron Jobs Tool

Scroll to the Advanced section and click Cron Jobs.


🕒 Step 3: Choose Email Notifications (Optional)

If you want to receive an email every time the cron job runs:

  • Enter your email address in the Cron Email field at the top
  • You’ll get a notification each time your script executes

💡 You can disable notifications later by redirecting output to /dev/null


🛠️ Step 4: Set the Time Interval

Use the Common Settings dropdown for popular options like:

  • Once per minute
  • Once per hour
  • Twice a day
  • Every day at midnight

Or manually define the schedule using:

  • Minute (0–59)
  • Hour (0–23)
  • Day of the month (1–31)
  • Month (1–12)
  • Weekday (0–6, where 0 = Sunday)

📥 Step 5: Add the Command

In the Command field, enter the path to the script or command you want to run. Example:

bashCopyEditphp /home/username/public_html/scripts/backup.php

Or, to suppress email output:

bashCopyEditphp /home/username/public_html/scripts/backup.php > /dev/null 2>&1

Click Add New Cron Job to save.


🔄 How to Edit or Delete Cron Jobs

Your active cron jobs will appear in a list below. From here, you can:

  • Edit the schedule or command
  • Delete the cron job if it’s no longer needed

🧠 Common Cron Job Examples

TaskCommand
Run WordPress cron manuallywget -q -O - https://yourdomain.com/wp-cron.php
Backup MySQL databasemysqldump -u db_user -p'yourpass' db_name > /home/username/backup.sql
Clean temporary filesrm -rf /home/username/tmp/*

⚠️ Always test scripts manually before setting them on auto-run via cron.


Setting up cron jobs in cPanel allows you to automate essential backend processes with precision. It saves time, reduces human error, and keeps your website running smoothly around the clock.

Need help with syntax or choosing the right schedule? Reach out to our support team — we’re happy to guide you through it.

Table of Contents