xref: /freebsd/usr.sbin/edquota/edquota.8 (revision cf02bf2407cb217c99cc82f78b7a2e7f0703c9ee)
1.\" Copyright (c) 1983, 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Robert Elz at The University of Melbourne.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. All advertising materials mentioning features or use of this software
16.\"    must display the following acknowledgement:
17.\"	This product includes software developed by the University of
18.\"	California, Berkeley and its contributors.
19.\" 4. Neither the name of the University nor the names of its contributors
20.\"    may be used to endorse or promote products derived from this software
21.\"    without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
35.\"	@(#)edquota.8	8.1 (Berkeley) 6/6/93
36.\" $FreeBSD$
37.\"
38.Dd June 6, 1993
39.Dt EDQUOTA 8
40.Os
41.Sh NAME
42.Nm edquota
43.Nd edit user quotas
44.Sh SYNOPSIS
45.Nm
46.Op Fl u
47.Op Fl f Ar fspath
48.Op Fl p Ar proto-username
49.Ar username ...
50.Nm
51.Op Fl u
52.Fl e
53.Sm off
54.Ar fspath Op : Ar bslim Op : Ar bhlim Op : Ar islim Op : Ar ihlim
55.Sm on
56.Op Fl e Ar ...
57.Ar username ...
58.Nm
59.Fl g
60.Op Fl f Ar fspath
61.Op Fl p Ar proto-groupname
62.Ar groupname ...
63.Nm
64.Fl g
65.Fl e
66.Sm off
67.Ar fspath Op : Ar bslim Op : Ar bhlim Op : Ar islim Op : Ar ihlim
68.Sm on
69.Op Fl e Ar ...
70.Ar groupname ...
71.Nm
72.Fl t
73.Op Fl u
74.Op Fl f Ar fspath
75.Nm
76.Fl t
77.Fl g
78.Op Fl f Ar fspath
79.Sh DESCRIPTION
80The
81.Nm
82utility is a quota editor.
83By default, or if the
84.Fl u
85flag is specified,
86one or more users may be specified on the command line.
87For each user a temporary file is created
88with an
89.Tn ASCII
90representation of the current
91disk quotas for that user.
92The list of file systems with user quotas is determined from
93.Pa /etc/fstab .
94An editor is invoked on the
95.Tn ASCII
96file.
97The editor invoked is
98.Xr vi 1
99unless the environment variable
100.Ev EDITOR
101specifies otherwise.
102.Pp
103The quotas may then be modified, new quotas added, etc.
104Setting a quota to zero indicates that no quota should be imposed.
105Setting a hard limit to one indicates that no allocations should
106be permitted.
107Setting a soft limit to one with a hard limit of zero
108indicates that allocations should be permitted only on
109a temporary basis (see
110.Fl t
111below).
112The current usage information in the file is for informational purposes;
113only the hard and soft limits can be changed.
114.Pp
115On leaving the editor,
116.Nm
117reads the temporary file and modifies the binary
118quota files to reflect the changes made.
119.Pp
120If the
121.Fl p
122option is specified,
123.Nm
124will duplicate the quotas of the prototypical user
125specified for each user specified.
126This is the normal mechanism used to
127initialize quotas for groups of users.
128If the user given to assign quotas to is a numerical uid
129range (e.g.\& 1000-2000), then
130.Nm
131will duplicate the quotas of the prototypical user
132for each uid in the range specified.
133This allows
134for easy setup of default quotas for a group of users.
135The uids in question do not have to be currently assigned in
136.Pa /etc/passwd .
137.Pp
138If one or more
139.Fl e
140.Sm off
141.Ar fspath Op : Ar bslim Op : Ar bhlim Op : Ar islim Op : Ar ihlim
142.Sm on
143options are specified,
144.Nm
145will non-interactively set quotas defined by
146.Ar bslim , bhlim , islim ,
147and
148.Ar ihlim
149on each particular file system referenced by
150.Ar fspath .
151Here
152.Ar bslim
153is the soft limit on the number of blocks,
154.Ar bhlim
155is the hard limit on the number of blocks,
156.Ar islim
157is the soft limit on the number of files, and
158.Ar ihlim
159is the hard limit on the number of files.
160If any of the
161.Ar bslim , bhlim , islim ,
162and
163.Ar ihlim
164values is omitted, it is assumed to be zero, therefore
165indicating that no particular quota should be imposed.
166.Pp
167If invoked with the
168.Fl f
169option,
170.Nm
171will read and modify quotas on the file system specified by
172.Ar fspath
173only.
174The
175.Ar fspath
176argument may be either a special device
177or a file system mount point.
178The primary purpose of this option is to set the scope for the
179.Fl p
180option, which would overwrite quota records on every
181file system with quotas otherwise.
182.Pp
183If the
184.Fl g
185flag is specified,
186.Nm
187is invoked to edit the quotas of
188one or more groups specified on the command line.
189The
190.Fl p
191flag can be specified in conjunction with
192the
193.Fl g
194flag to specify a prototypical group
195to be duplicated among the listed set of groups.
196Similarly,
197.Fl e
198flag can be specified in conjunction with
199the
200.Fl g
201flag to non-interactively set-up quotas on the listed set
202of groups.
203.Pp
204Users are permitted to exceed their soft limits
205for a grace period that may be specified per file system.
206Once the grace period has expired,
207the soft limit is enforced as a hard limit.
208The default grace period for a file system is specified in
209.In ufs/ufs/quota.h .
210The
211.Fl t
212flag can be used to change the grace period.
213By default, or when invoked with the
214.Fl u
215flag,
216the grace period is set for all the file systems with user
217quotas specified in
218.Pa /etc/fstab .
219When invoked with the
220.Fl g
221flag the grace period is
222set for all the file systems with group quotas specified in
223.Pa /etc/fstab .
224The grace period may be specified in days, hours, minutes, or seconds.
225Setting a grace period to zero indicates that the default
226grace period should be imposed.
227Setting a grace period to one second indicates that no
228grace period should be granted.
229.Pp
230Only the super-user may edit quotas.
231.Sh FILES
232.Bl -tag -width quota.group -compact
233.It Pa quota.user
234at the file system root with user quotas
235.It Pa quota.group
236at the file system root with group quotas
237.It Pa /etc/fstab
238to find file system names and locations
239.El
240.Sh SEE ALSO
241.Xr quota 1 ,
242.Xr quotactl 2 ,
243.Xr fstab 5 ,
244.Xr quotacheck 8 ,
245.Xr quotaon 8 ,
246.Xr repquota 8
247.Sh DIAGNOSTICS
248Various messages about inaccessible files; self-explanatory.
249