অটোমেশন
কমান্ড লাইন ও কীসহ ওয়েব ঠিকানায় ক্রন, পাঁচ মিনিটের ছন্দ, প্রতিটি কাজ ও কখন চলে, যে সেটিংস নিয়ন্ত্রণ করে, দৈনিক সামারি ইমেইল, আর হার্টবিট।
Everything that happens without a person pressing a button - renewal invoices, reminders, late fees, suspending an unpaid service, renewing and syncing domains, closing quiet tickets - is done by one script, cron/cron.php. You start it from the clock of your server every 5 minutes. It decides by itself which jobs are due. If the cron does not run, AIOBilling keeps working for people but nothing is billed, nobody is reminded and nobody is suspended, so this is the first thing to check on a new installation.
Setting up the cron
Open Setup → Automation Settings. The Cron job card shows two ready-made lines for your installation, each with a Copy button.
Command line (best). In cPanel open Cron Jobs, choose "Once Per Five Minutes" and enter the command that the page shows, which looks like:
*/5 * * * * /usr/local/bin/php -q /home/youruser/public_html/billing/cron/cron.php
On a VPS put the same line in crontab -e of the user that owns the site. Use the PHP of the same version the site runs on, with the full path.
Web cron address. If your host cannot run PHP from the command line, use the address with your secret cron key, and let a free cron service open it every 5 minutes:
https://billing.example.com/cron.php?key=YOUR-CRON-KEY
A wrong or missing key answers Invalid cron key with status 403. The key is under General Settings → Other → Cron Key; Regenerate makes a new one and the old address stops working, so change the cron job afterwards. Keep the key private.
For a site installed in a sub-folder, the web address includes the folder; the page shows the right one. See Installing.
The five-minute rhythm
Every run does four things: it writes the heartbeat, runs the jobs that are due, logs what each did, and records the time of the last run. Jobs have two kinds of timing:
- Daily jobs run once a day, on the first run after the Daily Cron Hour (default 02:00, set in Automation Settings, in your time zone). If the server was off at that hour they run on the next run of the day.
- Interval jobs run every N seconds: the heartbeat on every run, plugin tasks every 5 minutes, tickets every hour, usage every 24 hours, the licence every 12 hours.
Every job
| Job | When | What it does |
|---|---|---|
| heartbeat | Every run | Records the time, so the admin area can tell the cron is alive. |
| invoices (Generate invoices) | Daily | Creates renewal invoices for active services, addons, domains and due billable items whose invoice date has come. Skips a service with a pending cancellation request and anything already invoiced. Items due the same day share one invoice; Separate Invoices for Each Item and Group by Due Date change this. Closed clients are skipped. |
| reminders (Reminders and overdue notices) | Daily | Sends Invoice Payment Reminder N days before the due date and the First, Second and Third Invoice Overdue Notice N days after it. Each notice is sent once per invoice. A client with "override due notices" gets none. |
| late-fees (Late fees) | Daily | Adds the late fee to unpaid invoices that are late enough, once per invoice. Does nothing while the amount is 0. |
| suspensions | Daily | Suspends active services whose unpaid invoice is more than Suspend Days past due, and sends the suspension e-mail. Skips services with an override, a "suspend until" date in the future, and clients in a group that is exempt. Needs Automatic Suspension on. |
| terminations | Daily | Terminates suspended services unpaid for Terminate Days, and products that have a fixed term in days. Needs Automatic Termination on (it is off by default). |
| cancellations | Daily | Carries out cancellation requests: Immediate ones now, End of Billing Period ones on the next due date. |
| usage (Usage updates) | Every 24 hours | Asks each server module for disk and bandwidth use and stores it. See Services and servers. |
| domain-notices (Domain renewal notices) | Daily | Sends Domain Renewal Notice on the Renewal Notice Days, moves expired domains to Grace, Redemption or Expired by the extension's grace days, and sends Domain Expired Notice. |
| domain-sync (Domain sync) | Daily | Pulls expiry date and status from the registrar for up to 200 domains, oldest synced first. |
| tickets (Ticket auto-close and escalations) | Hourly | Closes tickets in an auto-close status that had no answer for Close Inactive Tickets hours (and sends the notification), then runs the escalation rules. |
| clients (Inactive clients) | Daily | Sets clients with no active service and no recent activity to Inactive after Inactive Clients (days) (and back to Active when they have an active service). Also tidies: signed-in sessions idle for 7 days, sign-in attempts older than 30 days, expired IP bans and automation log lines older than 90 days are deleted. |
| affiliates (Affiliate commissions) | Daily | Moves commissions whose clearing date has come into the affiliate's balance and adds new recurring commissions. The Payout Delay sets the clearing time. |
| currencies (Exchange rates) | Daily | Updates the rates of your currencies against the default currency from a public rate service. Only when Update Exchange Rates Daily is on. |
| license (Licence check) | Every 12 hours | Asks the License Center about your licence. See The licence. |
| plugins (Plugin tasks) | Every 5 minutes | Runs the cron task of every active plugin, for example a registrar or SMS plugin, and fires the ab_cron hook. A failing plugin is reported in the result and does not stop the others. Plugins can also add their own daily jobs. |
| summary (Daily summary e-mail) | Daily | See below. |
Settings that steer the cron
All of them are on Setup → Automation Settings (the same fields exist on the General Settings tabs).
| Card | Settings |
|---|---|
| Billing | Daily Cron Hour, Invoice Generation Days (how long before the due date the renewal invoice is made, default 7), Payment Terms, Payment Reminder Days (7), First, Second and Third Overdue Notice (1, 5 and 10 days), Late Fee Days, Automatically Apply Credit, Attach PDF Invoices. |
| Suspension and Termination | Automatic Suspension (on, 7 days), Unsuspend on Payment, Automatic Termination (off, 30 days). |
| Domains | Create Renewal Invoices (30 days before expiry), Renewal Notice Days (60,30,15,7,1), Automatic Registration, Automatic Renewal, Domain Sync. |
| Tickets | Close Inactive Tickets (72 hours), Auto Assign Tickets. |
| Clients and Other | Inactive Clients (90 days), Update Exchange Rates Daily, Payout Delay, Daily Summary E-mail. |
Per client and per service you can override some rules: no suspension, no auto-close, no due notices. See Clients and Services.
The daily summary
When Daily Summary E-mail is on (it is by default), the last daily job sends the administrators a message called Automation Summary with a table of every job that ran that day and its result, failures in red. It goes to administrators whose role has "System emails" ticked. Edit the text under Email Templates → Admin Messages. If a job fails, the failure is also written to data/logs/cron.log.
The heartbeat
Every run stores the time in the setting cron_heartbeat. The admin area reads it:
- The Automation Status widget on the dashboard shows Running when the last heartbeat is under 15 minutes old, otherwise Late or Never ran.
- Utilities → Automation Status shows Alive, Stale or No with the age, the last cron run, and per job the last result, its duration and the runs and failures of the last 7 days. Run now starts one job at once, ignoring its schedule; it needs
shell_exec, or runphp cron/cron.php <job> --forceby hand. - System Health & PHP Info shows the heartbeat too.
You can run one job from the command line: php cron/cron.php invoices --force. On the web address add &job=invoices&force=1. See Reports and utilities and, if the heartbeat is stale, Troubleshooting.
এই লেখাটি কি কাজে লেগেছে?
হালনাগাদ 2026-11-03