(10-07-2008 05:51 PM)FeG Wrote: This is already implemented in the ispCP engine if I'm right. You have to change in /var/www/ispcp/engine/quota/ispcp-dsk-quota the line 370:
Code:
$rs = mysqldb_quota_by_dir_engine();
to
Code:
$rs = mysqldb_quota_by_mysql_engine();
By doing so you switch from retrieving the space used by mysql-dbs from the 'du'-procedure to a method depending only on mysql queries.
Perfect! This is exactly what I was looking for. One quick note - the table status Data_length and Index_length values used by this functions appear to be returning data size in bits, and need to be converted to MB in
/var/www/ispcp/engine/quota/ispcp-dsk-quota the line 200:
Code:
$size += $data_length + $index_length;
to
Code:
$size += ($data_length / 1073741824) + ($index_length / 1073741824);
# 1073741824 = 1024 * 1024 * 1024 - convert bits to MB
Otherwise disk quota counts are WAY too high.
Note: I attempted to post a reply to this effect on the Ticket, but was rejected as 'possible spam'.