> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hostcloud.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up cron jobs

> Run a script or command automatically on a schedule in cPanel.

A cron job runs a command automatically at set times, for example a daily cleanup or a scheduled email. This guide shows you how to add one in cPanel.

**1. Open Cron Jobs**

[Log in to cPanel](/cpanel/log-in-to-cpanel.md), type **Cron Jobs** in the **Search Tools** box and open it.

**2. Choose when it runs**

Under **Add New Cron Job**, choose an option from **Common Settings**, such as once per hour or once per day. This fills in the timing fields for you. You can also set the minute, hour, day, month and weekday yourself.

**3. Enter the command**

In **Command**, enter what should run. Your app's instructions usually give you the exact command.

**4. Add it**

Click **Add New Cron Job**. It appears in the list of current cron jobs, where you can edit or delete it later.

## Example commands

Replace `username` with your cPanel username and `yourdomain.com` with your domain.

| What you want | Example command |
| - | - |
| Run a PHP script | `/usr/local/bin/php /home/username/public_html/cron.php` |
| Open a web address | `curl -s https://yourdomain.com/cron-task > /dev/null 2>&1` |
| Run WordPress scheduled tasks | `curl -s https://yourdomain.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1` |

Your cPanel username and home folder are shown on the cPanel home page, under **General Information**.

## Cron emails

cPanel can email you the output each time a job runs. Set the address under **Cron Email** at the top of the page. To stop the emails for a job, add `> /dev/null 2>&1` to the end of its command.

> [!TIP]
>
> Don't run jobs more often than you need. A job every minute uses resources all day and can slow your site down. Once an hour or once a day is enough for most tasks.

Still stuck? [Open a ticket](/support/open-a-ticket.md) with the command you're trying to run.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.