How to set up cron jobs in cPanel

This article describes how to use cPanel to configure cron jobs for your web site. Using cron jobs, you can schedule commands to run at intervals that you specify.

What is a cron job?

A cron job is simply a task that you schedule to run automatically at specific intervals. For example, if you want to back up a file every six hours, you can set this up easily using cPanel's cron jobs feature.

Adding a cron job

To add a cron job, follow these steps:

  1. Log in to cPanel.
    If you do not know how to log in to your cPanel account, please see this article.
  2. Open the Cron Jobs tool:
    • If you are using the Jupiter theme, on the Tools page, in the Advanced section, click Cron Jobs:

      cPanel - Advanced - Cron Jobs icon

    • If you are using the Paper Lantern theme, in the ADVANCED section of the cPanel home page, click Cron Jobs:

      cPanel - Advanced - Cron Jobs icon

  3. Under Cron Email, type the e-mail address where you want to receive notifications, and then click Update Email. Every time the cron job runs, the e-mail account receives a message.

    If you do not want to receive e-mail notifications for a particular cron job, you can append >/dev/null 2>&1 to the cron job command, which redirects all output to /dev/null.
  4. Under Add New Cron Job, specify the interval for the command you want.

    If you select an interval option under Common Settings, cPanel fills in the values automatically.
  5. In the Command text box, type the command that you want to run.

    Remember to specify the full path to files in cron jobs. For example, if you wanted to run a PHP script in a cron job, you would type /usr/local/bin/php /home/username/my_script.php.
  6. Click Add New Cron Job. cPanel creates the cron job.

Editing a cron job

To edit a cron job, follow these steps:

  1. Log in to cPanel.
    If you do not know how to log in to your cPanel account, please see this article.
  2. Open the Cron Jobs tool:
    • If you are using the Jupiter theme, on the Tools page, in the Advanced section, click Cron Jobs:

      cPanel - Advanced - Cron Jobs icon

    • If you are using the Paper Lantern theme, in the ADVANCED section of the cPanel home page, click Cron Jobs:

      cPanel - Advanced - Cron Jobs icon

  3. Under Current Cron Jobs, click Edit for the cron job that you want to edit.
  4. Make the changes that you want, and then click Edit Line.

Deleting a cron job

You can delete a cron job when you no longer want a command to run automatically.

To delete a cron job, follow these steps:

  1. Log in to cPanel.
    If you do not know how to log in to your cPanel account, please see this article.
  2. Open the Cron Jobs tool:
    • If you are using the Jupiter theme, on the Tools page, in the Advanced section, click Cron Jobs:

      cPanel - Advanced - Cron Jobs icon

    • If you are using the Paper Lantern theme, in the ADVANCED section of the cPanel home page, click Cron Jobs:

      cPanel - Advanced - Cron Jobs icon

  3. Under Current Cron Jobs, click Delete for the cron job that you want to delete.
  4. Confirm that the cron job is the one that you want to delete, and then click Delete. cPanel deletes the cron job.
Get cPanel Hosting

Article Details

Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.

We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.