expire
Check every hosted domain's registration and hosting expiry dates, store them, and notify by email and WhatsApp when they're close
- Command:
/go/expire - Category: Accounts
- Required option: None
- Output: One line per domain approaching expiry
- Last updated: 2026-11-20
On this page: Overview · Quick start · Syntax · Options · Output · Examples · Troubleshooting · Details · See also
Overview
/go/expire checks two separate dates for every hosted account and notifies the customer and the admin channels when either is close:
- Domain registration expiry — looked up live with
whoisfor every hosted domain, and saved to theSitetable. - Hosting account expiry — GoAdmio's own
ExpiresOndate for the account (set bycreateorrenew), read from theSitetable.
This command only reports; it does not renew anything. Run it on a schedule (daily, from cron) so customers get advance notice.
The call is appended to /var/log/go/expire.log.
Quick start
/go/expire
Syntax
/go/expire
The command takes no arguments.
Options
None. expire always checks every hosted account.
Output
A line is printed for each domain or account that falls in a notification window:
example.com Domain Expires On 2026-11-28 (8 days left)
example.com Hosting Expires On 2026-11-25 (5 days left)
No summary line is printed if nothing is close to expiring.
Examples
# Run it manually
/go/expire
# Check what's currently stored for a domain
sudo sqlite3 /var/lib/sqlite/site.db \
"select Domain, DomainExpiresOn, DomainDaysLeft, ExpiresOn, DaysLeft from Site where Domain='example.com'"
# Schedule it daily (see cron for the exact syntax GoAdmio expects)
/go/cron
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
whois: command not found |
The whois package isn't installed. |
Install it with your system's package manager. |
DomainExpiresOn is empty and DomainDaysLeft is -1000000 |
The registry's WHOIS output doesn't use the exact label Registrar Registration Expiration Date, or the domain has WHOIS privacy, or the registry rate-limited the query. |
Normal for some TLDs and registrars; the domain just won't get an expiry notification. |
| No domain-expiry notification even though it's close | Notifications only go out between 1 and 13 days left (see Windows). | Check the stored DomainDaysLeft; outside that window, nothing is sent. |
| Hosting-expiry notifications keep arriving for an account that expired long ago | The hosting check has no lower bound; see Known issues. | Renew the account with renew, or remove it. |
| The customer gets the WhatsApp message twice | A known duplicate-send bug; see Known issues. | Expected for now. |
| The email body shows odd characters near "Dear Customer" | A known encoding glitch in the hosting-expiry email text; see Known issues. | Cosmetic only. |
| The run is slow with many hosted domains | A live whois lookup runs for every domain, every time, with no delay between them. |
Expected; some registries may rate-limit if you have many domains. |
Details
Domain registration expiry
For every folder in /home with a www subfolder:
- Runs
whois <domain>and reads the lastRegistrar Registration Expiration Dateline in the output (there can be more than one; the last one in the raw output is used). - Trims it to
YYYY-MM-DD. If it doesn't look like a date,DomainDaysLeftis set to-1000000(effectively "unknown"). - Saves
DomainExpiresOnandDomainDaysLeftto theSitetable, every run, for every domain. - Sends a notification if
DomainDaysLeftis 1 to 13 inclusive.
Hosting account expiry
- Reads every account whose
ExpiresOn(the hosting expiry date set atcreate) is earlier than one month from today. - Recomputes
DaysLeftfrom that date and saves it. - Sends a notification. Unlike the domain check, there is no lower bound — see Known issues.
Windows
| Check | Notified when |
|---|---|
| Domain registration | DomainDaysLeft is 1–13 (just under two weeks) |
| Hosting account | DaysLeft is less than roughly 30 — including zero or negative |
There is no "already notified" flag, so a domain or account inside its window is notified again on every run — daily, if scheduled daily.
Notifications sent
For each flagged domain or account:
| Channel | Sent to |
|---|---|
info@<domain> |
|
The admin channel configured for /go/sendwhatsapp, and again to the account's saved mobile number if one is set — see Known issues |
expire does not renew anything itself. Renew the hosting account with renew; domain registration renewal happens with your domain registrar or registrar integration.
Known issues
- Hosting-expiry notifications never stop. The query is
ExpiresOn < (one month from today), with no lower bound, so an account that expired a year ago is still matched and notified on every run. The domain-registration check, by contrast, only notifies in a 1–13 day window. - The WhatsApp message is sent twice when a mobile number is saved. It is sent once unconditionally to the admin channel, then sent again, identically, inside the
if [ "$Mobile" != "" ]block — the second send does not actually use the mobile number as a separate recipient, it just repeats the same call. - The hosting-expiry email body has a stray character sequence (
Dear Customer,؜) before the greeting, a likely encoding mistake in the script. - No rate limiting between
whoislookups. A server with many hosted domains makes that many live WHOIS queries in a row every time this runs. for Result in $SQLis unquoted, so it splits on any whitespace, not just line breaks; this works today because domains and dates don't contain spaces, but it is fragile.
See also
| Command | Description |
|---|---|
renew |
Update the hosting expiry date in GoAdmio |
create |
Create a GoAdmio account from the command line |
contact |
Manage GoAdmio account contact details |
cron |
Set up main cron jobs in GoAdmio |
checkdomain |
Find the best available domain names for keywords |