Scheduled jobs (cron)
On this page
Some work happens in the background: retrying e-mail that was refused, re-checking the licence, warning dealers about warranties and overdue invoices, and the jobs of a few addons. One file does all of it, api/cron.php, and one cron line runs it.
The cron line (recommended)
In cPanel open Cron Jobs. Under Common Settings choose Once Per Five Minutes (*/5 * * * *) and put this in Command:
/usr/local/bin/php -q /home/USER/public_html/api/cron.php >/dev/null 2>&1
Replace USER with your cPanel user name, and public_html with the site's folder if it lives in a sub-domain or a sub-folder, for example /home/USER/public_html/dms/api/cron.php. The finish page of the installer showed the same command with the real folder of your server; it starts with plain php, which most cPanel servers want written as /usr/local/bin/php.
Run like this, as a PHP command, the job needs no key: the server's own cron is trusted. It works the same on hosts that start cron jobs through php-cgi.
Over the web, with the cron key
When your host does not allow PHP commands, open the web address instead, from the host's cron with curl, or from an online cron service such as cron-job.org:
*/10 * * * * curl -s "https://your-domain/api/cron.php?key=YOUR_CRON_KEY" >/dev/null 2>&1
The installer creates the cron key. You find it:
- with the Backup & Restore addon on, on its page (Backup & Restore in the Addons group of the sidebar), card Automatic backups: the complete line with your key and a Copy button;
- otherwise in phpMyAdmin, table
dms_settings, the row whosekiscron_key.
Treat the key like a password. To change it, give that row a new value; the old address stops working at once.
Without the right key the address answers Cron key missing. or Invalid cron key. and does nothing.
What every run does
| Job | What it does |
|---|---|
| Mail queue | Sends up to 50 e-mails that are waiting. A refused message is tried again on later runs, at least five minutes apart, five times in all. After that it is marked failed on E-mail Setup. |
| Licence | Asks the License Center about your key. This keeps Last checked fresh, and brings down addons you bought, notices and footer links. |
| Warranty notices | Finds warranty cards that end exactly n days from today and tells their dealer Warranty expiring soon in the dealer portal. n is Warn this many days before a warranty expires in the Warranty & Guarantee addon's settings (30 to begin with). |
| Overdue invoices | Finds invoices with money still due whose due date was yesterday and tells their dealer Invoice overdue. |
| Scheduled backup | With the Backup & Restore addon: takes the backup when one is due and the clock is in the hour set as Around which hour (0-23). |
| Sync log | With the Online & Offline Sync addon: removes log rows older than Keep the sync log for (days). |
Warranty and overdue notices go only to cards and invoices that belong to a dealer.
How often
Every five or ten minutes is right. Run it at least once an hour, or a scheduled backup can miss its hour. The warranty and overdue checks look at today's date only, so a day without any run is skipped, not caught up later.
Checking that it runs
- Open the web address with your key in a browser. A working run answers in plain text, one line per job:
DMS cron run 2026-10-14 10:05:00
mail queue : 0 sent, 0 still failing
license : verified
warranty notices: 2 sent
overdue notices : 0 sent
backup : module off
- Admin → Activity Logs, choose the action
cronand press Filter. Every run leaves one row with the same summary. - Admin → License: Last checked should say a few minutes ago.
If none of these move, the cron line is not running: check the path, and that the command starts with the PHP program (/usr/local/bin/php on most cPanel servers). Remove >/dev/null 2>&1 for a moment and cPanel sends what the job printed to the address under Cron Email, which usually shows the reason.
Without a cron job
The site still works. E-mail is sent the moment it is written, and the licence is checked when staff open the admin panel. What stops is everything that has to happen on its own: retrying refused e-mail, warranty and overdue notices, scheduled backups and sync log clean-up.
The cron job also keeps the licence fresh when nobody from head office opens the panel for days. Without it, a week with no staff sign-in can run out the offline grace period, and the dealer portal locks until a staff member signs in again. See The licence key and addon keys.