# Setting up cron jobs in cPanel

> Schedule cron jobs in cPanel to run scripts or commands automatically, and set where cron notification emails go.

Source: https://helpcenter.ruachost.com/cpanel/advanced/setting-up-cron-jobs-in-cpanel/

This article explains how to use **cPanel** to configure cron jobs for your website. Cron jobs allow you to set up automated commands that run at intervals you specify, which are perfect for backups, script execution, or routine maintenance.

## What Is a Cron Job?

A **cron job** is simply a scheduled task that runs automatically at specific intervals. Example: You can configure a cron job to back up a file every six hours without manual effort.

## Adding a Cron Job

1. **Log in to cPanel.**
2. On the **Tools page → Advanced section**, click **Cron Jobs**.
3. Under **Cron Email**, type the email address where you want to receive notifications, then click **Update Email**.

   - Every time the cron job runs, you’ll receive a message.
   - To disable notifications, append this to your command:

     ```
     >/dev/null 2>&1
     ```
4. Under **Add New Cron Job**, specify the interval for the command you want.

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

   - **Important:** Always specify the full path to files in cron jobs.
   - Example:

     ```
     /usr/local/bin/php /home/username/my_script.php
     ```

     ```
     Click Add New Cron Job.
     ```
   - cPanel creates the cron job.

## Editing a Cron Job

1. Log in to **cPanel**.
2. Go to **Tools → Advanced → Cron Jobs**.
3. Under **Current Cron Jobs**, click **Edit** for the job you want to change.
4. Make your changes, then click **Edit Line**.

## Deleting a Cron Job

1. Log in to **cPanel**.
2. Go to **Tools → Advanced → Cron Jobs**.
3. Under **Current Cron Jobs**, click **Delete** for the job you want to remove.
4. Confirm deletion.

   - cPanel deletes the cron job.

> **Note:**
- Cron jobs run on server time, which is UTC (GMT+0). For example, 09:00 in Lagos (UTC+1) is 08:00 server time.
- Incorrect paths or permissions may cause jobs to fail.
- Avoid scheduling too many jobs at short intervals to prevent server overload.
