One of the most common questions we received is "What's the other usage in my cPanel account and how do I locate the information?"
The "Other usage" are files not within your cPanel user's /home directory and are owned by the cPanel users. As well as the metadata that the system uses to store email in the mail directory, the email in Trash folders, or the files that you do not have permission to access.
The most common file types would be emails contents, backups, or /tmp.
Below is a command you could use to locate files outside of the cPanel user's home directory but own by the cPanel user in a text file format.
cpaneluser=username && find / -path /home/virtfs -prune -o -path /home/${cpaneluser} -prune -o -user "${cpaneluser}" -type f -ls > files_outside_homedir.txt 2>/dev/null
Note: Please cpaneluser=username to the actual cPanel username at the end. For example, your cPanel username is cPtech, then it should be cpaneluser=cPtech
Once the text file is created, you can use the command below to calculate the disk size.
awk '{SUM += $7} END {print SUM}' files_outside_homedir.txt
The output above will get you the number of filesystem blocks used as filesystem quotas are based on block.
In order to get an idea of the conversion between blocks and size, you can run the following command:
stat -c "%b blocks of %B bytes per block" /path/to/file
For example, if a file is using 16 blocks that are 512 bytes each, the total size of that file on disk is 8k, even though the file might only actually appear to be 5.4K.
If you do not find any large file outside the home directory, it could also due to an open file which you can locate with the following command:
lsof +L1 | awk '{if ($7 > 0) print}'
Comments
0 comments
Article is closed for comments.