Haioken

Member
Feb 27, 2017
7
0
1
Australia
cPanel Access Level
Root Administrator
Hi All,

I'm trying to reconcile user disk usage from API2 DiskUsage::fetchdiskusagewithextras, however individual line items show higher usage the main value

In the below output, I've removed irrelevant entries from $.data.homedir.contents for more concise viewing.

You can see that the quota used is listed as 5037907968. (4804MB)
This however doesn't make sense, as the directory 'mail' (and the related entry 'mailaccounts') report 5852950958. (5581 MB)
That's ~777Mb unexplained difference.

Code:
{
  "cpanelresult": {
    "module": "DiskUsage",
    "data": [
      {
        "skipmailman": "",
        "mysql": null,
        "mailarchives": 4096,
        "mailman": 0,
        "quotalimit": 7864320000,
        "mailaccounts": 5852950958,
        "quotaused": 5037907968,
        "pgsql": 0,
        "homedir": {
          "name": "/home/[[REDACTED]]",
          "user_contained_usage": 5864161710,
          "owner": "[[REDACTED]]",
          "contained_usage": 5864161710,
          "contents": [
            {
              "user_contained_usage": 5852950958,
              "name": "mail",
              "contents": 2,
              "type": "dir",
              "usage": 4096,
              "traversible": 1,
              "contained_usage": 5852950958,
              "owner": "[[REDACTED]]"
            }, [...]
          ],
          "type": "dir",
          "traversible": 1,
          "usage": 4096
        }
      }
    ],
    "func": "fetchdiskusagewithextras",
    "event": {
      "result": 1
    },
    "apiversion": 2
  }
}
The output of du for the mail dir seems to correlate perfectly however
Code:
# du -sb /home/[[REDACTED]]/mail
4992815235    mail
# echo $((4992815235 / 1048576))
4761
When accounting for other disk usage items, this is very close to the 4804Mb reported quotaused value.
I have attempted altering the disablequotacache value in /var/cpanel/cpanel.config, but this has made absolutely no difference.