নির্ধারিত কাজ (ক্রন)
এই অধ্যায়টি এখনও অনুবাদ হয়নি, তাই ইংরেজিতে দেখানো হচ্ছে।
এই পাতায়
Some work has to happen whether or not anybody is signed in: retrying an e-mail that failed, re-checking the licence, reminding a patient about tomorrow's appointment, sending the next batch of a campaign, taking the nightly backup. All of it runs from one file, api/cron.php, which your server's cron should start every five minutes.
Setting it up in cPanel
cPanel → Cron Jobs → Add New Cron Job:
- Common settings: Once Per Five Minutes (
*/5 * * * *). - Command:
/usr/local/bin/php -q /home/CPANELUSER/public_html/api/cron.php >/dev/null 2>&1
Replace CPANELUSER with your cPanel user name, and public_html with the folder the script is in if it is in a sub-domain or sub-folder (for example public_html/clinic). On most cPanel servers PHP is /usr/local/bin/php; your host's help pages say if it is different.
Run as a command like this, the job needs no key: the server's own cron is trusted. It also works when your host starts cron through php-cgi, which many do.
Running it over the web instead
Some hosts only allow cron to fetch an address. Then use:
*/5 * * * * curl -s "https://your-domain/api/cron.php?key=YOUR_CRON_KEY" >/dev/null 2>&1
Over the web the key is required, so nobody else can trigger the jobs. The key is generated at installation. With the Backup & Restore addon switched on, its screen shows this exact line with your own key filled in and a Copy button. A request with a wrong or missing key gets Invalid cron key or Cron key missing and nothing runs.
An external service such as cron-job.org can call the same address if your host has no cron at all.
What each run does
| Job | What happens |
|---|---|
| Mail queue | Sends e-mail that is waiting and retries messages that failed (50 at a time). |
| Licence check | Re-checks the licence with the License Center (and collects addon keys you bought). |
| Warranty notices | Tells each dealer, on their dashboard, about warranties that run out in 30 days (the Warranty addon decides how many days). |
| Overdue notices | The day after an invoice to a dealer passes its due date with money owing, tells that dealer. |
| Scheduled backup | With Backup & Restore: takes the backup when it is due and sends it off-site. |
| Sync log housekeeping | With Online & Offline Sync: deletes old sync log rows. |
| Appointment reminders | With Appointments: sends the reminder for appointments starting within the set number of hours (24 by default), once each. |
| Follow-ups due | With Patient & Customer Management: a notification for every follow-up due today, to the person it is assigned to. |
| Trials that ended | With Hearing Aid Management: tells the staff whose trial ended yesterday, with the patient's number to call. |
| Campaigns and reminders | With Notifications & Marketing: sends the next batch of a running campaign and raises the automatic reminders (service due, warranty ending, birthdays). |
| Visitor housekeeping | With Visitor Analytics: removes visits older than the period you keep. |
Every switched-on addon that has scheduled work of its own is asked in turn, so an addon you install later is included without changing the cron line.
How often
Every five minutes is right. Each job knows when it last ran and does nothing when there is nothing to do, so a run usually takes a second. Less often is fine too — every 10 or 15 minutes — but appointment reminders and the mail queue then go out a little later. Once an hour is the slowest that still makes sense.
Is it working?
- Run the command once by hand in cPanel's Terminal (or open the web address with the key in a browser). It prints a short report:
HCBS cron run 2026-10-15 09:05:00
mail queue : 3 sent, 0 still failing
license : verified
warranty notices: 0 sent
overdue notices : 1 sent
backup : not due
...
- System → E-mail Setup → the Mail queue should empty itself within minutes.
- The Last backup tile on the dashboard should show last night's backup.
- Last checked on the License page should never be more than the re-check interval old.
If the report says Not installed., the path points to the wrong folder. If nothing seems to happen, check the cron e-mail your host sends (remove >/dev/null 2>&1 for a day to receive the output).