Automation and Cron Tasks
WHMCS relies on a main cron task to execute all its automatic processes: billing, renewals, domain synchronisation, email sending, etc. Correct cron configuration is essential for the HostMyServers registrar module to function properly.
Configure the Main Cron Task
The WHMCS cron task must be executed every 5 minutes on your server. From your server control panel (cPanel, Plesk, or directly via crontab), add the following entry:
*/5 * * * * /usr/bin/php -q /path/to/whmcs/crons/cron.php
Replace /path/to/whmcs/ with the absolute path to your WHMCS installation.
If you're unsure of the path, connect via SSH and run pwd from the WHMCS root directory. On a typical cPanel setup, this will often be /home/youruser/public_html/ or similar.
Via cPanel
- Log in to cPanel
- Go to Scheduled Tasks (Cron Jobs)
- In the Command field, enter:
/usr/bin/php -q /home/YOUR_USER/public_html/crons/cron.php
- Select the frequency: Every 5 minutes
- Click Add Cron Job
Via SSH / crontab
crontab -e
Add the line:
*/5 * * * * /usr/bin/php -q /var/www/whmcs/crons/cron.php > /dev/null 2>&1
Domain Synchronisation Task
In addition to the main cron, WHMCS has a dedicated task for domain synchronisation. It runs automatically via the main cron, but you can also run it manually.
Manual Synchronisation
From the WHMCS administration:
Utilities → Domain Synchronisation
This page allows you to:
- Run a full synchronisation immediately
- View the latest synchronisation results
- Identify domains whose status or expiry date differs between WHMCS and HostMyServers
Recommended Frequency
Automatic synchronisation triggers once a day via the main cron. This is sufficient in most cases. If you manage a large volume of domains or frequently perform operations directly from the HostMyServers client area, you can increase the frequency:
0 */6 * * * /usr/bin/php -q /var/www/whmcs/crons/cron.php --do DomainStatusSync > /dev/null 2>&1
This will run a synchronisation every 6 hours.
Automatic Renewals
WHMCS manages automatic renewals according to each domain's configuration. Here is the standard workflow:
| Time before expiry | WHMCS action |
|---|---|
| D-30 | Generate renewal invoice |
| D-14 | 1st client email reminder |
| D-7 | 2nd client email reminder |
| D-0 | Expiry (if invoice unpaid) |
| D+x | Service suspension (depending on configuration) |
Automatic Renewal at HostMyServers
By default, the module does not enable automatic renewal at HostMyServers (it is WHMCS that triggers the renewal via the API). If you want domains to be automatically renewed by HostMyServers independently of WHMCS, enable the Auto-renewal option in your HostMyServers client area.
Avoid enabling automatic renewal both in WHMCS and in your HostMyServers client area, at the risk of billing and renewing the same domain twice.
Automatic Renewal Emails
WHMCS automatically sends reminder emails to your clients before their domains expire. These emails use the templates configured in:
Setup → System → Email Templates → Domains category
Templates relevant to HostMyServers domains:
| Template | Trigger |
|---|---|
Domain Expiry Notice | Reminders before expiry (D-30, D-14, D-7) |
Domain Renewal Successful | Renewal confirmation |
Domain Transfer Initiated | Incoming transfer started |
Domain Transfer Completed | Transfer completed |
Customise these templates to match your brand and commercial messaging. Available variables (domain name, expiry date, payment link, etc.) are listed in the WHMCS editor on hover.
Verifying the Cron is Running Correctly
To verify that the cron is running correctly:
- In the WHMCS administration, go to Utilities → Activity → Activity Logs
- Filter by type Cron
- Verify that recent entries are present (every 5 minutes)
If no entries appear for more than 15 minutes, the cron is not configured or not running. Check the server-side configuration and any error messages in the PHP logs.