How to set up cron jobs in aaPanel
Schedule automated tasks with aaPanel on an UnderHost VPS or dedicated server. Run PHP scripts, shell commands, backups, database dumps, WordPress cron,
On this page
aaPanel's cron job manager supports multiple task types, so you do not need to write cron syntax manually for common tasks like backups. For custom scripts, a shell or URL task type gives full flexibility. On UnderHost VPS and dedicated servers, cron jobs run inside your server environment, so always test paths, permissions, and resource usage before scheduling frequent tasks.
Cron job types in aaPanel
| Task type | Use case |
|---|---|
| Shell script | Run any shell command or PHP script |
| Backup site | Automatic site file backup with retention limit |
| Backup database | Automatic database SQL dump with retention |
| Visit URL | Trigger a URL (e.g., WordPress wp-cron via HTTP) |
Create a cron job
- Log in to aaPanel and click Cron Jobs in the left sidebar
- Click Add task
- Select the task type
- Configure the task-specific settings (script path, site to back up, URL to visit)
- Set the execution frequency (see schedule options below)
- Give the task a name for identification
- Click Add task
aaPanel saves the task and adds it to the system crontab. You can view, edit, or delete tasks from the Cron Jobs list.
Schedule options
aaPanel presents schedule options as dropdowns rather than raw cron syntax:
| Frequency option | Equivalent cron expression |
|---|---|
| Every N minutes | */N * * * * |
| Every hour at minute X | X * * * * |
| Every day at HH:MM | MM HH * * * |
| Every week on day X at time | MM HH * * X |
| Every month on day X | MM HH X * * |
For tasks not covered by the UI presets, select Shell script and write a script that uses the date command to handle advanced scheduling logic.
Common examples
WordPress dedicated cron (every 5 minutes):
- Add task → Type: Shell script
- Command:
/usr/bin/php /www/wwwroot/yourdomain.com/wp-cron.php > /dev/null 2>&1 - Schedule: Every 5 minutes
Then disable WordPress's built-in wp-cron in wp-config.php:
define('DISABLE_WP_CRON', true);
For busy WooCommerce or membership sites, a real cron is more reliable than visitor-triggered WordPress cron and reduces random page-load delays.
WordPress cron via URL (alternative):
- Add task → Type: Visit URL
- URL:
https://yourdomain.com/wp-cron.php?doing_wp_cron - Schedule: Every 5 minutes
Daily database backup at 3am:
- Add task → Type: Backup database
- Select database, set retention to 7
- Schedule: Every day at 03:00
Clear application cache daily:
- Add task → Type: Shell script
- Command:
find /www/wwwroot/yourdomain.com/cache/ -name "*.php" -mtime +1 -delete - Schedule: Every day at 04:00
Cron not running
- Wrong PHP path: Run
which phpover SSH to find the correct binary. On aaPanel with multiple PHP versions, a specific version binary path looks like/www/server/php/81/bin/php - Wrong file path: Use the full absolute path-relative paths do not work in cron. Confirm the file exists at the path you specified
- Script errors: Remove
> /dev/null 2>&1temporarily and check the task log in aaPanel → Cron Jobs → log icon for the task - Permission denied: Ensure the script file is readable and executable. Check ownership matches the web server user
- Task log in aaPanel: aaPanel stores cron output logs-click the log icon next to any task to view recent execution output and errors
- Resource spikes: If a backup, import, or cache task slows the server, schedule it during low-traffic hours and check CPU, RAM, and disk usage in aaPanel monitoring
Related: aaPanel backups | Create website in aaPanel | CloudPanel cron jobs | cPanel cron jobs
Need aaPanel hosting?
Install aaPanel on an UnderHost VPS or dedicated server when you want a simple web interface for sites, databases, SSL, and apps.





















