Site Cron and Scheduled Tasks
Who this is for
Users who need to run scheduled tasks for their site — for example, WordPress's WP-Cron, database cleanup jobs, cache warming scripts, or custom PHP/shell scripts.
Prerequisites
- Site is running with SSH connectivity.
- Site app type supports cron (WordPress and Custom app types). Static sites do not have cron.
What Site Cron Does
The Cron tab on the site detail lets you manage the crontab entries for the site. Cron jobs run as the cloudpilot user on a schedule you define using standard cron syntax.
Cron Schedule Syntax
Cron jobs use 5-field syntax:
* * * * * command
│ │ │ │ │
│ │ │ │ └── Day of week (0–7, where 0 and 7 = Sunday)
│ │ │ └──── Month (1–12)
│ │ └────── Day of month (1–31)
│ └──────── Hour (0–23)
└────────── Minute (0–59)
Common examples:
| Schedule | Meaning |
|---|---|
*/5 * * * * | Every 5 minutes |
0 * * * * | Every hour at :00 |
0 2 * * * | Every day at 2:00 AM |
0 2 * * 0 | Every Sunday at 2:00 AM |
0 0 1 * * | First day of every month at midnight |
How to Add a Cron Job
- Open the site detail → Cron tab.
- Click + Add Cron Job.
- Fill in:
- Schedule: cron expression (e.g.,
*/15 * * * *) - Command: the shell command to run (e.g.,
php /var/www/myblog/wp-cron.php)
- Click Save.
CloudAIPilot writes the entry to the cloudpilot user's crontab on the server.
WordPress WP-Cron Setup
By default, WordPress uses a virtual cron that runs when users visit the site. For more reliable scheduling (especially on low-traffic sites), disable the built-in WP-Cron and use a real cron job:
- Add
define('DISABLE_WP_CRON', true);towp-config.phpvia the File Manager. - Add a cron job with the schedule
*/15 * * * *and command:
php /var/www/[your-site-docroot]/wp-cron.php > /dev/null 2>&1
How to Edit or Delete a Cron Job
- In the Cron tab, find the job.
- Click Edit to modify the schedule or command.
- Click Delete (trash icon) to remove it.
Changes take effect immediately — CloudAIPilot updates the server's crontab in real time.
What Success Looks Like
The cron job appears in the list. The server's crontab is updated. For WP-Cron, WordPress events (scheduled posts, email notifications) run reliably on schedule.
Common Issues and Fixes
| Issue | Likely cause | Fix |
|---|---|---|
| Cron tab not available | Site is a Static type | Static sites don't support cron. Use a Custom app type if you need cron. |
| Cron job runs but command fails | Wrong path or missing executable | Test the command manually in the server Terminal tab. |
| Output or errors from cron job | Cron output goes to server mail | Redirect output: append > /dev/null 2>&1 to silence, or >> /var/log/my-cron.log 2>&1 to log it. |
| WP-Cron still not running | DISABLE_WP_CRON not set | Verify wp-config.php has define('DISABLE_WP_CRON', true); |