NetBSD/usr.sbin/quotactl/quotactl.8

138 lines
5.1 KiB
Groff

.\" $NetBSD: quotactl.8,v 1.4 2011/03/07 17:44:37 njoly Exp $
.\"
.\" Copyright (c) 2011 Manuel Bouyer
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\"
.Dd January 31, 2011
.Dt QUOTACTL 8
.Os
.Sh NAME
.Nm quotactl
.Nd send commands to the kernel disk quota subsystem
.Sh SYNOPSIS
.Nm
.Op Fl \&Dx
.Ar file-system
.Op Ar plist
.Sh DESCRIPTION
.Nm
reads a property list of commands from the specified file or stdin,
and sends it to the kernel for the specified file system through the
.Xr quotactl 2
system call.
.Pp
Available options:
.Bl -tag -width Ds
.It Fl D
Debug: print plist sent to and received from kernel to stderr.
.It Fl x
Do not parse reply from kernel for errors and print it to stdout.
.El
.Pp
If
.Fl x
is not specified,
.Nm
parses the reply from the kernel, looking at each command return value
and reporting errors.
.Sh EXIT STATUS
.Nm
exists with 0 on success.
If there was problems parsing the command plist,
or the reply from the kernel, or if the
.Xr quotactl 2
system call returned an error, the exit status will be 1.
Unless
.Fl x
is present, a message is printed to stderr for each failed command,
and the exit status will be 2 if any comand failed.
.Sh EXAMPLES
This will set the quota limits for user id 100 on the file system
.Pa /home :
.Bd -literal
quotactl /home << EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>commands</key>
<array>
<dict>
<key>command</key>
<string>set</string>
<key>data</key>
<array>
<dict>
<key>block</key>
<dict>
<key>expire time</key>
<integer>0</integer>
<key>grace time</key>
<integer>2419200</integer>
<key>hard</key>
<integer>0x2000</integer>
<key>soft</key>
<integer>0x1000</integer>
<key>usage</key>
<integer>0x0</integer>
</dict>
<key>file</key>
<dict>
<key>expire time</key>
<integer>0</integer>
<key>grace time</key>
<integer>172800</integer>
<key>hard</key>
<integer>0x800</integer>
<key>soft</key>
<integer>0x400</integer>
<key>usage</key>
<integer>0x0</integer>
</dict>
<key>id</key>
<integer>100</integer>
</dict>
</array>
<key>type</key>
<string>user</string>
</dict>
</array>
<key>interface version</key>
<integer>0x1</integer>
</dict>
</plist>
EOF
.Ed
.Sh SEE ALSO
.Xr quota 1 ,
.Xr quotactl 2 ,
.Xr proplib 3 ,
.Xr edquota 8 ,
.Xr repquota 8
.Sh HISTORY
The
.Nm
command appeared in
.Nx 6.0 .