> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://docs.flyinghost.com/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 Cron Jobs Work

FlyingHost uses a managed system cron instead of WordPress's traffic-triggered cron. This makes scheduled tasks more reliable and keeps cron checks out of normal page requests.

## How it works

FlyingHost sets:

```php
define('DISABLE_WP_CRON', true);
```

A system cron then calls wp-cron.php locally every five minutes.

Each run includes a random delay of up to 239 seconds to spread server load. A task therefore runs during the next cron window, not necessarily at an exact minute.

The cron request:

- Runs as the non-root wordpress user
- Runs locally inside the site's container
- Has a 120-second timeout
- Uses a PHP worker while it is running

Do not remove DISABLE_WP_CRON or add another external cron trigger. Duplicate triggers can increase PHP and database load.

## What uses WordPress cron

Typical tasks include:

- Scheduled posts
- Plugin update checks
- Backups and security scans
- Email queues
- Cache cleanup or preload
- WooCommerce background processing
- Membership renewals and reminders
- Plugin-created scheduled events

## View scheduled events

Open **Web Terminal** in Cockpit. It starts in:

```text
/var/www/public
```

List scheduled events:

```bash
wp cron event list
```

Show the most useful fields:

```bash
wp cron event list --fields=hook,next_run_gmt,next_run_relative,recurrence
```

Run all currently due events:

```bash
wp cron event run --due-now
```

Run one specific event:

```bash
wp cron event run your_hook_name
```

Only run a specific hook when you know what it does. Payment, email, backup, and cleanup hooks can have side effects.

## WooCommerce Scheduled Actions

WooCommerce and many extensions use Action Scheduler.

Go to **WooCommerce → Status → Scheduled Actions** to view pending or failed actions. A large backlog often points to a plugin error, slow external service, or more work than one cron run can complete.

## Custom tasks

For WordPress-related work, register a WP-Cron event in a plugin or use a trusted scheduling plugin.

The Web Terminal does not provide root access, so you cannot edit the managed system cron or create services. Contact FlyingHost support if a task genuinely requires an operating-system cron.

## Troubleshooting

If a task is late or failing:

1. Confirm the hook exists with wp cron event list.
2. Allow for the five-minute interval and randomized delay.
3. Confirm the plugin that created the event is active.
4. Check Cockpit and WordPress logs for PHP errors.
5. Run the hook manually and review the output.
6. Check WooCommerce Scheduled Actions for a backlog.
7. Check PHP worker, CPU, and memory usage at the same time.

Jobs cannot run longer than 120 seconds in one request. Large imports, backups, scans, and syncs should process smaller batches and continue during later cron runs.