📌 Purpose & Quick Summary
The Cron Jobs automation engine allows you to schedule recurring tasks and background commands on your server. Ideal for triggering Laravel task schedules (php artisan schedule:run), WordPress cron triggers (wp-cron.php), database maintenance scripts, and automated report generators, BoostonCP combines simple scheduling presets with standard 5-field cron syntax and live output logs.
Figure 19: Cron Jobs management interface showing active automated tasks and live execution logs.
🖥️ Interface Tour & Elements
- Deploy New Task Button: Launches the cron job creation modal.
- Cron Job Creation Modal:
- Task Name: Friendly description (e.g. Laravel Scheduler).
- Preset Intervals Dropdown: Quick presets (Every Minute, Hourly, Twice Daily, Daily at Midnight, Weekly, Monthly).
- Custom Cron Fields: Individual inputs for Minute, Hour, Day of Month, Month, and Day of Week (
* * * * *). - Command String: The exact shell command to execute.
- Active Jobs Ledger Table: Displays Task Name, Status Toggle, Schedule Frequency, Command, Last Run Timestamp, View Log action, and Delete button.
Figure 19.1: Deploy New Task modal showing interval presets and command input.
🛠️ Step-by-Step Instructions
Step 1: Creating a Cron Job
- In the sidebar, click Cron Jobs (icon:
fa-clock). - Click the DEPLOY NEW TASK button.
- In the modal:
- Task Name: Enter
WordPress Cron. - Frequency: Select Hourly (or Every 15 minutes).
- Command: Enter the full command:
/usr/bin/php /home/user/public_html/wp-cron.php >/dev/null 2>&1
- Task Name: Enter
- Click Deploy Task. The Linux crontab for your user is updated immediately.
Step 2: Viewing Execution Output Logs
- Locate your cron task in the ledger.
- Click the View Logs button (document icon).
- Inspect the terminal modal to view the exact output and exit status generated during the last run.
⚙️ Complete Field & Parameter Reference Table
| Field | Syntax | Example | Description |
|---|---|---|---|
| Minute | 0 - 59 |
*/15 |
Runs every 15 minutes. |
| Hour | 0 - 23 |
2 |
Runs at 2:00 AM. |
| Day of Month | 1 - 31 |
1 |
Runs on the first day of each month. |
| Month | 1 - 12 |
* |
Every month. |
| Day of Week | 0 - 7 (0=Sun) |
0 |
Runs every Sunday. |
| Mute Output | >/dev/null 2>&1 |
Append to command | Discards standard output and prevents inbox spam. |
❓ Troubleshooting & Common Errors
1. Command Fails with "PHP: command not found"
- Cause: Using relative binary paths without specifying the absolute PHP executable.
- Solution: Always specify the absolute binary path (e.g.
/usr/bin/phpor/usr/bin/php8.2).