barrie_spence@agilent.com wrote:
I've just been busy writing a script to manage and enforce quotas the "UNIX way" (i.e. lock down the quota at the soft limit if the user doesn't cleanup within 14 days of exceeding it).
The CPAN Perl "Quota" module works a treat:
use Quota;
$host='filer'; $volume_path = '/vol/vol1/users'; $uid = 501; ($block_curr, $block_soft, $block_hard, $block_timelimit, $inode_soft, $inode_hard, $inode_timelimit) = Quota::rpcquery($host, $volume_path, $uid);
It's pretty fast and appears to work on HP-UX, Solaris and Linux. The
You are right. I did some tests comparing issuing quota command and this procedure call. In the first case collecting several quota results took under 50 ms. In the second case - under 4 ms. So it was fast enough to use it as workaround for calculating group quota by summing up quota usage of all UIDs in the group. (assuming that only few UIDs belong to GID).
Thank you very much for good hint!
Best regards,
Jacek