]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - usr.sbin/rmt/rmt.8
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / usr.sbin / rmt / rmt.8
1 .\" Copyright (c) 1983, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 4. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)rmt.8       8.3 (Berkeley) 6/1/94
29 .\" $FreeBSD$
30 .\"
31 .Dd June 1, 1994
32 .Dt RMT 8
33 .Os
34 .Sh NAME
35 .Nm rmt
36 .Nd remote magtape protocol module
37 .Sh SYNOPSIS
38 .Nm
39 .Sh DESCRIPTION
40 The
41 .Nm
42 utility is used by the remote dump and restore programs
43 in manipulating a magnetic tape drive through an interprocess
44 communication connection.
45 It is normally started up with an
46 .Xr rcmd 3
47 call.
48 .Pp
49 The
50 .Nm
51 utility accepts requests specific to the manipulation of
52 magnetic tapes, performs the commands, then responds with
53 a status indication.
54 All responses are in
55 .Tn ASCII
56 and in
57 one of two forms.
58 Successful commands have responses of:
59 .Bd -ragged -offset indent
60 .Sm off
61 .Sy A Ar number No \en
62 .Sm on
63 .Ed
64 .Pp
65 .Ar Number
66 is an
67 .Tn ASCII
68 representation of a decimal number.
69 Unsuccessful commands are responded to with:
70 .Bd -ragged -offset indent
71 .Sm off
72 .Xo Sy E Ar error-number
73 .No \en Ar error-message
74 .No \en
75 .Xc
76 .Sm on
77 .Ed
78 .Pp
79 .Ar Error-number
80 is one of the possible error
81 numbers described in
82 .Xr intro 2
83 and
84 .Ar error-message
85 is the corresponding error string as printed
86 from a call to
87 .Xr perror 3 .
88 The protocol is comprised of the
89 following commands, which are sent as indicated - no spaces are supplied
90 between the command and its arguments, or between its arguments, and
91 .Ql \en
92 indicates that a newline should be supplied:
93 .Bl -tag -width Ds
94 .Sm off
95 .It Xo Sy \&O Ar device
96 .No \en Ar mode No \en
97 .Xc
98 .Sm on
99 Open the specified
100 .Ar device
101 using the indicated
102 .Ar mode .
103 .Ar Device
104 is a full pathname and
105 .Ar mode
106 is an
107 .Tn ASCII
108 representation of a decimal
109 number suitable for passing to
110 .Xr open 2 .
111 If a device had already been opened, it is
112 closed before a new open is performed.
113 .Sm off
114 .It Xo Sy C Ar device No \en
115 .Xc
116 .Sm on
117 Close the currently open device.
118 The
119 .Ar device
120 specified is ignored.
121 .Sm off
122 .It Xo Sy L
123 .Ar whence No \en
124 .Ar offset No \en
125 .Xc
126 .Sm on
127 Perform an
128 .Xr lseek 2
129 operation using the specified parameters.
130 The response value is that returned from the
131 .Xr lseek 2
132 call.
133 .Sm off
134 .It Sy W Ar count No \en
135 .Sm on
136 Write data onto the open device.
137 The
138 .Nm
139 utility reads
140 .Ar count
141 bytes from the connection, aborting if
142 a premature end-of-file is encountered.
143 The response value is that returned from
144 the
145 .Xr write 2
146 call.
147 .Sm off
148 .It Sy R Ar count No \en
149 .Sm on
150 Read
151 .Ar count
152 bytes of data from the open device.
153 If
154 .Ar count
155 exceeds the size of the data buffer (10 kilobytes), it is
156 truncated to the data buffer size.
157 The
158 .Nm
159 utility then performs the requested
160 .Xr read 2
161 and responds with
162 .Sm off
163 .Sy A Ar count-read No \en
164 .Sm on
165 if the read was
166 successful; otherwise an error in the
167 standard format is returned.
168 If the read
169 was successful, the data read is then sent.
170 .Sm off
171 .It Xo Sy I Ar operation
172 .No \en Ar count No \en
173 .Xc
174 .Sm on
175 Perform a
176 .Dv MTIOCOP
177 .Xr ioctl 2
178 command using the specified parameters.
179 The parameters are interpreted as the
180 .Tn ASCII
181 representations of the decimal values
182 to place in the
183 .Ar mt_op
184 and
185 .Ar mt_count
186 fields of the structure used in the
187 .Xr ioctl 2
188 call.
189 The return value is the
190 .Ar count
191 parameter when the operation is successful.
192 .It Sy S
193 Return the status of the open device, as
194 obtained with a
195 .Dv MTIOCGET
196 .Xr ioctl 2
197 call.
198 If the operation was successful,
199 an ``ack'' is sent with the size of the
200 status buffer, then the status buffer is
201 sent (in binary).
202 .El
203 .Pp
204 Any other command causes
205 .Nm
206 to exit.
207 .Sh DIAGNOSTICS
208 All responses are of the form described above.
209 .Sh SEE ALSO
210 .Xr rcmd 3 ,
211 .Xr mtio 4 ,
212 .Xr rdump 8 ,
213 .Xr rrestore 8
214 .Sh HISTORY
215 The
216 .Nm
217 utility appeared in
218 .Bx 4.2 .
219 .Sh BUGS
220 People should be discouraged from using this for a remote
221 file access protocol.