UnderHost
Knowledgebase Docs

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 typeUse case
Shell scriptRun any shell command or PHP script
Backup siteAutomatic site file backup with retention limit
Backup databaseAutomatic database SQL dump with retention
Visit URLTrigger a URL (e.g., WordPress wp-cron via HTTP)

Create a cron job

  1. Log in to aaPanel and click Cron Jobs in the left sidebar
  2. Click Add task
  3. Select the task type
  4. Configure the task-specific settings (script path, site to back up, URL to visit)
  5. Set the execution frequency (see schedule options below)
  6. Give the task a name for identification
  7. 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 optionEquivalent cron expression
Every N minutes*/N * * * *
Every hour at minute XX * * * *
Every day at HH:MMMM HH * * *
Every week on day X at timeMM HH * * X
Every month on day XMM 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):

  1. Add task → Type: Shell script
  2. Command: /usr/bin/php /www/wwwroot/yourdomain.com/wp-cron.php > /dev/null 2>&1
  3. 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):

  1. Add task → Type: Visit URL
  2. URL: https://yourdomain.com/wp-cron.php?doing_wp_cron
  3. Schedule: Every 5 minutes

Daily database backup at 3am:

  1. Add task → Type: Backup database
  2. Select database, set retention to 7
  3. Schedule: Every day at 03:00

Clear application cache daily:

  1. Add task → Type: Shell script
  2. Command: find /www/wwwroot/yourdomain.com/cache/ -name "*.php" -mtime +1 -delete
  3. Schedule: Every day at 04:00

Cron not running

  • Wrong PHP path: Run which php over 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>&1 temporarily 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

Was this article helpful?

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.

Related articles

Back to aaPanel