fixquota
Recalculate every account's disk and bandwidth usage, block FTP uploads over the disk quota, and suspend expired accounts
- Command:
/go/fixquota - Category: Accounts
- Required arguments: None
- Output: Status lines for accounts that hit a limit, then a table of usage in bytes
- Last updated: 2026-11-19
On this page: Overview · Quick start · Syntax · Output · What is counted · What is enforced · Examples · Troubleshooting · Details · See also
Overview
/go/fixquota measures how much disk space and bandwidth each hosting account has used, and acts on the limits. For every account it:
- measures disk space and this month's bandwidth, and saves both in the panel
- turns FTP uploads off when the disk quota is exceeded
- prints a message when the bandwidth limit is exceeded
- suspends the account when its hosting has expired
Afterwards it restarts the FTP server.
The command is not the same as quota, which enables system disk quotas. fixquota only measures and enforces the limits stored in the panel.
Quick start
/go/fixquota
Syntax
/go/fixquota
The command has no arguments or options.
Output
example.com Disk quota exceeded. disable FTP uploading...
Suspend other.com Web Hosting Expired.
Domain Space Bandwidth
example.com 1234567890 987654321
other.com 52428800 1048576
| Message | Meaning |
|---|---|
<domain> Disk quota exceeded. disable FTP uploading... |
Disk use is at or over the quota. FTP uploads are switched off. |
<domain> enable FTP uploading... |
Disk use is back under the quota, and uploads are switched on again. |
Suspend <domain> Bandwidth Limit Exceeded. |
The bandwidth limit is reached. Nothing is suspended, because the suspend call is disabled in the script. |
Suspend <domain> Web Hosting Expired. |
The hosting expiry date has passed, and the account is suspended. |
The table at the end has one row per account. Space and Bandwidth are in bytes. The exit code is 0.
Logging
Every run is appended to /var/log/go/fixquota.log.
What is counted
| Value | How it is measured |
|---|---|
| Disk space | The size in bytes of the whole /home/<domain> folder (files, mail, SQLite files, trash, and so on), plus the sizes of the account's MySQL/MariaDB databases. |
| Mail space | The size of /home/<domain>/mail. It is already part of the disk space. |
| Bandwidth | This month's web traffic from the panel's bandwidth records, plus this month's FTP transfers from the FTP log. |
| Database size | Data plus index size of each MySQL/MariaDB database, as reported by the database server. |
Not counted: PostgreSQL databases, /var/cache/<domain>, /backup/<domain>, S3 storage, and mail traffic. Sizes are the apparent size of the files in bytes, which can be lower than the space they occupy on disk.
The disk quota and bandwidth limit of each account are the DiskSpace and Bandwidth values stored in the panel, in bytes. A value of 0 means no limit.
What is enforced
| Limit | What happens |
|---|---|
| Disk quota exceeded | FTP uploads are switched off for the domain. Web uploads, PHP writes, databases, and incoming mail are not stopped, so the account can keep growing. |
| Bandwidth limit exceeded | A message only. |
Hosting expired (ExpiresOn has passed) |
The account is suspended with suspend. |
The script has commented-out lines for suspending accounts over their disk or bandwidth limits, and a comment saying that an email will be sent instead. No email is sent.
Examples
# Recalculate usage and apply the limits
/go/fixquota
# See the saved numbers for every account
sqlite3 /var/lib/sqlite/site.db "SELECT Domain, SpaceUsed, DiskSpace, BandwidthUsed, Bandwidth, ExpiresOn FROM Site"
# Look at an account's FTP permission file
cat /etc/vsftpd/permission/example.com
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| FTP uploads stay off after the account is under quota again | The line added when the quota was exceeded is write_enable=NO, but the line removed afterwards is download_enable. |
Run permission for the domain, or remove the write_enable=NO lines from /etc/vsftpd/permission/<domain> and restart vsftpd. |
The permission file has many write_enable=NO lines |
One line is added on every run while the account is over quota. | Remove the duplicates. |
Suspend ... Bandwidth Limit Exceeded. but the account still works |
The suspend call is disabled; only the message is printed. | Suspend it yourself with suspend if needed. |
| An account was suspended unexpectedly | ExpiresOn has passed, or it is empty. |
Check ExpiresOn, and set it with renew, then run unsuspend. |
| An account was unsuspended unexpectedly | When FTP uploads are switched on again the script runs unsuspend, which also lifts suspensions that have other causes. |
Suspend it again, and see Notes for maintainers. |
| Usage looks too low | PostgreSQL, /var/cache/<domain>, /backup/<domain>, S3 data, and mail traffic are not counted. |
None needed; this is how it measures. |
Bandwidth is always 0 |
There are no bandwidth records, or the FTP month filter doesn't match the dates in the FTP log. | Check the bandwidth records (see bandwidth) and the Date column of the FTP log. |
| FTP transfers drop when the command runs | The FTP server is restarted at the end of every run. | Run it at a quiet time, or less often. |
integer expression expected |
An account has no Bandwidth value. |
Set the limit for the account (0 for none). |
| The site keeps growing past its quota | Only FTP uploads are blocked. | Suspend the account, or limit it in another way. |
Details
What it does
- Re-runs itself with
sudoif not root, and logs the call. - Runs
ftplogto refresh the FTP log data. - Measures every MySQL/MariaDB database (except the system ones) and saves its size in the panel.
- For every folder in
/homethat has awwwfolder and a row in theSitetable:- Measures disk space, mail space, web bandwidth for this month, and FTP bandwidth for this month.
- Saves
SpaceUsed,BandwidthUsed, andMailSpaceUsedin the panel. - If disk use is at or over the quota (and the quota is not
0): appendswrite_enable=NOto/etc/vsftpd/permission/<domain>and setsFTPUploadto-1. - Otherwise, if the account was blocked before (
FTPUploadis-1): removesdownload_enablelines from the permission file, setsFTPUploadto1, and runsunsuspend. - If bandwidth use is at or over the limit (and the limit is not
0): prints a message. - If the current time is later than
ExpiresOn: runssuspendfor the domain.
- Prints the usage table.
- Restarts
vsftpd.
flowchart TD
A["fixquota"] --> B["ftplog, measure database sizes"]
B --> C["For each account"]
C --> D["Measure space and bandwidth, save"]
D --> E{"Over disk quota?"}
E -- "Yes" --> F["Disable FTP uploads"]
E -- "No" --> G["If blocked before: enable FTP uploads, unsuspend"]
F --> H{"Over bandwidth?"}
G --> H
H --> I{"Hosting expired?"}
I -- "Yes" --> J["Suspend account"]
I -- "No" --> K["Next account"]
J --> K
K --> L["Print table, restart vsftpd"]
Notes for maintainers
| Issue | Why it matters | Suggested fix |
|---|---|---|
Disabling adds write_enable=NO, enabling removes download_enable |
The block may never be lifted, unless unsuspend rebuilds the file. |
Remove the same line that was added, for example sed -i "/^write_enable=NO/d". |
| The line is appended on every run | Duplicate lines pile up. | Add it only if it isn't there yet. |
| A comment says an email is sent instead of a suspension, but no code sends one | Customers and admins get no warning. | Add the notification, or fix the comment. |
The bandwidth message says Suspend but nothing is suspended |
Misleading. | Change the text, or suspend the account. |
unsuspend runs when FTP uploads are switched on again |
It can also lift a suspension that had another cause. | Restore only the FTP permission file. |
An empty ExpiresOn is read by date -d as today at midnight |
The account is suspended. The expiry date itself is also already "expired" from midnight. | Skip empty values, and compare against the end of the day. |
Bandwidth isn't normalized like DiskSpace |
An empty value causes an integer error. | Use printf "%.0f" on it too. |
PostgreSQL, /var/cache/<domain>, /backup/<domain>, and S3 data aren't counted, while mail and trash are |
Usage doesn't match what the account really uses. | Add the missing locations, and decide whether mail counts. |
FTP traffic is selected with Date like '%<Mon> <Year>%' |
It depends on how ftplog stores dates and on the server language. A date like Fri Nov 20 12:34:56 2026 doesn't contain Nov 2026. |
Store and compare timestamps. |
vsftpd is restarted on every run |
Active FTP transfers are cut. | Reload it, or restart only when a permission file changed. |
du runs over the whole home of every account on every run |
Heavy disk load on large servers. | Run at a quiet time, or use filesystem quotas. |
| The database root password is on the command line, once per database | Visible in the process list. | Use a credentials file. |
HostingExpired, Day, and Month are set but never used |
Dead code. | Remove them. |
The table is printed in bytes from an unquoted echo |
Hard to read. | Convert with numfmt --to=iec, and quote the output. |
| Domain names are placed directly in SQL | A quote in a folder name breaks a query. | Validate names against ^[a-z0-9.-]+$. |
See also
| Command | Description |
|---|---|
quota |
Enable disk quotas in GoAdmio |
bandwidth |
Set or check monthly bandwidth limits per domain |
suspend |
Suspend a GoAdmio account via the command line |
unsuspend |
Unsuspend a GoAdmio account via the command line |
renew |
Update the hosting expiry date in GoAdmio |
expire |
Check hosting and domain expiry dates and send email/WhatsApp notifications |
permission |
Enable or disable FTP permissions for a domain |
ftplog |
Report FTP activity for a domain |
dbls |
List all databases and their sizes |