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

# Cron Jobs

A cron job is a scheduled task that runs automatically at defined intervals. Common uses include running maintenance scripts, sending queued emails, processing imports, and triggering application schedulers (such as WordPress's wp-cron or Laravel's scheduler).

## Creating a cron job in cPanel

1. Log in to cPanel.
2. In the **Advanced** section, click **Cron Jobs**.

![image](https://files.readme.io/6d59ee0-cron_jobs.png)

3. Under **Add New Cron Job**, set the schedule. You can pick a common preset from the **Common Settings** dropdown (for example, "Once Per Day") or set the five schedule fields manually:
   * **Minute** (0-59)
   * **Hour** (0-23)
   * **Day** (1-31)
   * **Month** (1-12)
   * **Weekday** (0-6, Sunday = 0)
4. In the **Command** field, enter the command to run.
5. Click **Add New Cron Job**.

## Example commands

Run a PHP script:

```shell theme={null}
/usr/local/bin/php /home/username/public_html/script.php
```

Fetch a URL (for example, to trigger wp-cron):

```shell theme={null}
wget -q -O /dev/null https://example.com/wp-cron.php?doing_wp_cron
```

Run a script and discard all output:

```shell theme={null}
/usr/local/bin/php /home/username/script.php > /dev/null 2>&1
```

<Note>
  Replace username with your cPanel username and adjust paths to match your account.
</Note>

## Email output

By default, cron sends any command output to your account's email address. Set the email in the **Cron Email** section of the Cron Jobs page, or append `> /dev/null 2>&1` to a command to silence its output.

## Tips

* **Don't schedule jobs too frequently.** Very frequent jobs (every minute) that run heavy scripts can consume your account's resources. Choose the longest interval that meets your needs.
* **Replace wp-cron with a real cron job.** WordPress's built-in wp-cron runs on page visits, which is unreliable on low-traffic sites and wasteful on busy ones. Disable it in wp-config.php with `define('DISABLE_WP_CRON', true);` and schedule the wget command above every 10-15 minutes instead.
* **Use full paths** in commands — cron runs with a minimal environment and may not find binaries otherwise.

If you need help setting up a cron job, contact our support team.
