Command line access for quota settings
Back to Index
Managing quota settings
WinQuota contains command-line tool quotactl.exe which provides the same behavior as GUI does. It gives a possibility to show and modify quota settings for directories. QuotaCtl allows the following commands:
QuotaCtl [options...] command
Where commands are:
- -show [-uid Uid] file... shows quota status for files or directories; optionally only one account can be shown. Uid is a proper name such as group, user, or domain\user.
- -set [-uid Uid] file[=size]... updates quota for files or directories. Note: these command settings are applied to nested directories automatically. If no uid specified, credentials Anyone will be used.
- -drop [-uid Uid] file... removes quota for files or directories. Note: these command settings are applied to nested directories. If no uid specified, credentials Anyone will be used.
The following command displays the current settings of a specified directory:
C:>quotactl -show c:\qtest
Path Account Soft Limit Hard Limit Real Size(%)
c:/qtest BUILTIN\Power Users 500K 500K 303K(60%)
c:/qtest SERVER6\Administrator 500K 500K 396K(79%)
c:/qtest Anyone 1024K 1024K 396K(38%)
The following command updates the current settings of specified directory (actually it will be doubled):
C:>quotactl.exe -set c:\qtest=2M
The following commands calculates amount of files currently used on disk:
- -size [-uid Uid] file... computes how much space is allocated. When user specified, only files that created by this user are computed. Uid is a proper name such as group, user, or domain\user.
- -owns -uid Uid file... displays list of files were created by particular user.
Note: these commands will be applied to nested directories.
Note: Uid is proper name such as 'group', 'user', 'domain'.
Note: the form 'host\user' is also acceptable.
To operate with exclude list, you can use the following commands:
- -show-exlist show exclude files now being used.
- -add-exlist-path path add new exclude file.
- -del-exlist-path path remove exclude file from list.
- -del-exlist remove all exclude files.
To operate with administrative accounts list, you can use the following commands:
- -show-mgrlist show administrative accounts now being used.
- -add-mgrlist-uid uid add new uid.
- -del-mgrlist-uid uid remove uid from list.
- -del-mgrlist remove all uids.
Note: Uid is proper name such as 'group', 'user', 'domain'.
Note: the form 'host\user' is also acceptable.
To operate with notofications list, you can use the following commands:
- -show-notflist show registered notifications.
- -add-notflist-path path add new script.
- -del-notflist-path path remove script from list.
- -del-notflist remove all notifications.
Checking quota settings consistency and repairing
Additionally WinQuota contains another command line tool called 'quotachk.exe'. This tool provides offline checking of quota entries and allows correcting all entries automatically. It allows the following commands:
QuotaChk [options...] [-R drive...]
Where options are:
- -v shows all non-critical warnings and informational strings. By default quotachk works in the quiet mode.
- -F performs repair.
- -R rescan whole disk(s), and collect newly added quotas to fast access. Here you can specify disks you need to rescan.
QuotaChk passes list of drives in canonical form like C:\.
The following command repairs the quota counters of the specified drive:
C:>quotachk -v -R c:\
Warning: c:\\QTEST: quota counter underflow to Anyone; [quota=406032 < disk=594176]; FIXED
This is typical form to chek quota counters:
C:>quotachk -v
This is example that fixes quota counters:
C:>quotachk -F
|