The two files contained in this packages are drop-in replacements for /usr/local/cpanel/bin/quota
and /usr/local/cpanel/bin/safe_fetch_repquota
. It reports quota to cPanel so that you get warning emails and information back to WHM accounts list and to the cPanel account sidebar. However, it won't enforce quotas, ie. users can go overquota.
You still need quota binaries installed, and quota-reporting support for NFS mounts. You also need PHP installed because I don't know Perl.
It has been tested on WHM/cPanel 11.38.2.
Possibly, it hasn't been thoroughly tested. Try quota -vw julien
. If you get an output like the one below, chances are high it will work :)
Block grace time: 7days; Inode grace time: 7days Block limits File limits User used soft hard grace used soft hard grace 10.x.y.z:/nfs-server/home 6989867 0 0 0 0 0
Just run the following commands as root:
cd /usr/local/cpanel/bin/
mv quota quota.bak
wget https://raw.github.com/cahri/cpanel-nfs-quota/master/quota
chmod 755 quota
mv safe_fetch_repquota safe_fetch_repquota.bak
wget https://raw.github.com/cahri/cpanel-nfs-quota/master/safe_fetch_repquota
chmod 755 safe_fetch_repquota
- 1.0.1: removed dependency on POSIX libary
- 1.0.0: initial release
It doesn't work if your NFS server does not report quotas. Feel free to improve the script to use du
in such a case (with some caching involved since it's resource-intensive).
Obviously, WHM/cPanel updates might break this script or overwrite it.
Concept and development by Julien Tessier for Cahri.