xref: /netbsd/usr.sbin/edquota/edquota.8 (revision 6550d01e)
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. Neither the name of the University nor the names of its contributors
16.\"    may be used to endorse or promote products derived from this software
17.\"    without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\"	from: @(#)edquota.8	8.2 (Berkeley) 4/27/95
32.\"	$NetBSD: edquota.8,v 1.12 2003/08/07 11:25:20 agc Exp $
33.\"
34.Dd December 4, 2002
35.Dt EDQUOTA 8
36.Os
37.Sh NAME
38.Nm edquota
39.Nd edit user quotas
40.Sh SYNOPSIS
41.Nm
42.Op Fl u
43.Op Fl f Ar filesystem
44.Op Fl p Ar proto-username
45.Ar username ...
46.Nm
47.Fl g
48.Op Fl f Ar filesystem
49.Op Fl p Ar proto-groupname
50.Ar groupname ...
51.Nm
52.Op Fl u
53.Op Fl f Ar filesystem
54.Op Fl h Ar block#/inode#
55.Op Fl s Ar block#/inode#
56.Ar username ...
57.Nm
58.Fl g
59.Op Fl f Ar filesystem
60.Op Fl h Ar block#/inode#
61.Op Fl s Ar block#/inode#
62.Ar groupname ...
63.Nm
64.Op Fl u
65.Op Fl f Ar filesystem
66.Fl t
67.Nm
68.Fl g
69.Op Fl f Ar filesystem
70.Fl t
71.Sh DESCRIPTION
72.Nm
73is a quota editor.
74By default, or if the
75.Fl u
76flag is specified,
77one or more users may be specified on the command line.
78Unless
79.Fl h
80or
81.Fl s
82are used, a temporary file is created for each user with an ASCII
83representation of the current disk quotas for that user.
84The list of filesystems with user quotas is determined from
85.Pa /etc/fstab .
86By default, quota for all quota-enabled filesystems are edited; the
87.Fl f
88option can be used to restrict it to a single filesystem.
89An editor is invoked on the ASCII file.
90The editor invoked is
91.Xr vi 1
92unless the environment variable
93.Ev EDITOR
94specifies otherwise.
95.Pp
96The quotas may then be modified, new quotas added, etc.
97Setting a quota to zero indicates that no quota should be imposed.
98Setting a hard limit to one indicates that no allocations should
99be permitted.
100Setting a soft limit to one with a hard limit of zero
101indicates that allocations should be permitted on
102only a temporary basis (see
103.Fl t
104below).
105The current usage information in the file is for informational purposes;
106only the hard and soft limits can be changed.
107.Pp
108On leaving the editor,
109.Nm
110reads the temporary file and modifies the binary
111quota files to reflect the changes made.
112.Pp
113If the
114.Fl p
115flag is specified,
116.Nm
117will duplicate the quotas of the prototypical user
118specified for each user specified.
119This is the normal mechanism used to initialize quotas for groups of users.
120.Pp
121The
122.Fl h
123and
124.Fl s
125flags can be used to change quota limits (hard and soft, respectively)
126without user interaction, for usage in e.g. batch scripts.
127The arguments are the new block and inode number limit, separated by a slash.
128.Pp
129If the
130.Fl g
131flag is specified,
132.Nm
133is invoked to edit the quotas of
134one or more groups specified on the command line.
135The
136.Fl p
137flag can be specified in conjunction with the
138.Fl g
139flag to specify a prototypical group
140to be duplicated among the listed set of groups.
141.Pp
142Users are permitted to exceed their soft limits
143for a grace period that may be specified per filesystem.
144Once the grace period has expired,
145the soft limit is enforced as a hard limit.
146The default grace period for a filesystem is specified in
147.Pa /usr/include/ufs/ufs/quota.h .
148The
149.Fl t
150flag can be used to change the grace period.
151By default, or when invoked with the
152.Fl u
153flag, the grace period is set for all the filesystems with user
154quotas specified in
155.Pa /etc/fstab .
156When invoked with the
157.Fl g
158flag the grace period is
159set for all the filesystems with group quotas specified in
160.Pa /etc/fstab .
161The grace period may be specified in days, hours, minutes, or seconds.
162Setting a grace period to zero indicates that the default
163grace period should be imposed.
164Setting a grace period to one second indicates that no
165grace period should be granted.
166.Pp
167Only the super-user may edit quotas.
168.Sh FILES
169.Bl -tag -width 24n -compact
170.It Pa quota.user
171at the filesystem root with user quotas
172.It Pa quota.group
173at the filesystem root with group quotas
174.It Pa /etc/fstab
175to find filesystem names and locations
176.El
177.Sh DIAGNOSTICS
178Various messages about inaccessible files; self-explanatory.
179.Sh SEE ALSO
180.Xr quota 1 ,
181.Xr quotactl 2 ,
182.Xr fstab 5 ,
183.Xr quotacheck 8 ,
184.Xr quotaon 8 ,
185.Xr repquota 8
186