File::quotas - Interface to quotas databases
use File::quotas; $quotas = new File::quotas( ); # to load data form existing mount point $quotas = new File::quotas('/mount/point/'); # OR, to load data from a specific path $quotas = new File::quotas('/path/to/file/quotasFile'); $quotas->display_quotas(); # add the quota on uid 10 $quotas->set_entry(10, '75000', '100000', '75000', '100000'); $quotas->write_quotas('/path/to/file/quotasFile');
File::quotas provides a perl interface to 'quotas' files.
new() Constructor. Returns new instance of File::quotas. display_quotas() Displays quota information once loaded in human-readable form. load_quotas() parameters: $mountPoint, mount point to read 'quotas' from, like /export/home. You can also pass a direct path instead of a mount point. Decompresses quotas file and loads into object. write_quotas() parameters: $mountPoint, mount point to write 'quotas' to, like /export/home. You can also pass a direct path instead of a mount point. Recompresses relevant object data into quotas file. set_entry() parameters: $uid, UID or username to apply quota to. $blocks_soft, soft disk block limit in bytes. $blocks_hard, hard disk block limit in bytes. $inodes_soft, soft index node limit in bytes. $inodes_hard, hard index node limit in bytes. Sets quota entry for UID write_one_quota() parameters: $mountPoint, mount point with 'quotas' file you wish to update, or an exact path to a quotas file. $uid, the UID (not username) with a new entry. Before calling this method, you *must* make the entry using set_entry() first. This is generally an internal function. del_entry() parameters: $uid, UID to delete quota. Deletes quota entry for UID null_data() Internal function, used for object reuse.
To install this module type the following:
perl Makefile.PL make make install
All testing so far has been done on solaris. Other than that, all demons sighted have been expelled, see CHANGES document for more info.
Copyleft 2005-2012 Charles A Morris.
Additional contributions from: Jesse L Becker (firstname.lastname@example.org)
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.