> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.elitehost.co.za/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How do I set up Cron Jobs in cPanel?

Cron jobs allow you to automate tasks on your server by scheduling scripts or commands to run at specific times or intervals. This is especially useful for tasks like regular backups, clearing caches, or sending scheduled emails. Follow the steps below to set up a cron job in cPanel.

### Steps to Set Up a Cron Job in cPanel

1. **Log into cPanel**:
   * Access cPanel using your credentials. (Refer to our article: [How do I log into cPanel?](/en/article/how-do-i-log-into-cpanel-1wzhlku/))

2. **Locate Cron Jobs**:
   * Scroll down to the **Advanced** section.
   * Click on **Cron Jobs**.

3. **Set Up Email Notifications (Optional)**:
   * If you want to receive an email notification every time the cron job runs, enter your email address in the **Cron Email** section and click **Update Email**. 
   * If you do not want notifications, simply ensure there is no email set, or add `>/dev/null 2>&1` at the end of your cron job command to suppress email output.

4. **Add a New Cron Job**:
   * In the **Add New Cron Job** section, you’ll see a dropdown menu for **Common Settings**. Here, you can choose a predefined interval for your cron job (e.g., once per day, every minute, every week).
   * Alternatively, you can manually set the schedule using the fields provided for **Minute, Hour, Day, Month, and Weekday**. For example:
     * `*/5 * * * *` – This will run the job every 5 minutes.

5. **Enter the Command to Run**:
   * In the **Command** field, enter the command or script you want to run. This can be a PHP script, shell script, or another command. Example:
     ```
     /usr/local/bin/php /home/yourusername/public_html/cron.php
     ```
     Replace `/home/yourusername/public_html/cron.php` with the actual path to your script.

6. **Click Add New Cron Job**:
   * Once you’ve set the timing and command, click **Add New Cron Job** to save your new cron task.

If you need further assistance, feel free to contact our [support team](https://my.elitehost.co.za/submitticket.php?step=2&deptid=14) or email helpdesk@elitehost.co.za.