]> git.wh0rd.org - dump.git/blame_incremental - rmt/rmt.8.in
Lots of fixes from Philipe Troin:
[dump.git] / rmt / rmt.8.in
... / ...
CommitLineData
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.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" $Id: rmt.8.in,v 1.9 2002/07/24 14:12:01 stelian Exp $
33.\"
34.TH RMT 8 "version __VERSION__ of __DATE__" BSD "System management commands"
35.SH NAME
36rmt \- remote magtape protocol module
37.SH SYNOPSIS
38.B rmt
39.SH DESCRIPTION
40.B Rmt
41is a program used by the remote
42.BR dump (8),
43.BR restore (8)
44or
45.BR tar (1)
46programs in manipulating a magnetic tape drive through an interprocess
47communication connection.
48.B Rmt
49is normally started up with an
50.BR rexec (3)
51or
52.BR rcmd (3)
53call.
54.PP
55The
56.B rmt
57program accepts requests specific to the manipulation of magnetic tapes,
58performs the commands, then responds with a status indication. All responses
59are in
60.B ASCII
61and in one of the following two forms.
62.PP
63Successful commands have responses of:
64.RS
65.B A\fInumber\fR\en
66.RE
67.PP
68where
69.I number
70is an
71.B ASCII
72representation of a decimal number.
73.PP
74Unsuccessful commands are responded to with:
75.RS
76.B E\fIerror-number\fR\en\fIerror-message\fR\en
77.RE
78.PP
79where
80.I error-number
81is one of the possible error numbers described in
82.BR intro (2)
83and
84.I error-message
85is the corresponding error string as printed from a call to
86.BR perror (3).
87.PP
88The protocol is comprised of the following commands, which are sent as
89indicated - no spaces are supplied between the command and its arguments, or
90between its arguments, and \en indicates that a newline should be supplied:
91.TP
92.B O\fIdevice\fR\en\fImode\fR\en
93Open the specified
94.I device
95using the indicated
96.IR mode .
97.I Device
98is a full pathname and
99.I mode
100is an
101.B ASCII
102representation of a decimal number suitable for passing to
103.BR open (2).
104If a device had already been opened, it is closed before a new open is
105performed.
106.TP
107.B C\fIdevice\fR\en
108Close the currently open device. The
109.I device
110specified is ignored.
111.TP
112.B L\fIwhence\fR\en\fIoffset\fR\en
113Perform an
114.BR lseek (2)
115operation using the specified parameters. The response value is that returned
116from the
117.B lseek
118call.
119.TP
120.B W\fIcount\fR\en
121Write data onto the open device.
122.B Rmt
123reads
124.I count
125bytes from the connection, aborting if a premature end-of-file is encountered.
126The response value is that returned from the
127.BR write (2)
128call.
129.TP
130.B R\fIcount\fR\en
131Read
132.I count
133bytes of data from the open device. If
134.I count
135exceeds the size of the data buffer (10 kilobytes), it is truncated to the
136data buffer size.
137.B Rmt
138then performs the requested
139.BR read (2)
140and responds with
141.B A\fIcount-read\fR\en
142if the read was successful; otherwise an error in the standard format is
143returned. If the read was successful, the data read is then sent.
144.TP
145.B I\fIoperation\fR\en\fIcount\fR\en
146Perform a
147.B MTIOCOP
148.BR ioctl (2)
149command using the specified parameters. The parameters are interpreted as the
150.B ASCII
151representations of the decimal values to place in the
152.B mt_op
153and
154.B mt_count
155fields of the structure used in the
156.B ioctl
157call. The return value is the
158.I count
159parameter when the operation is successful.
160.IP
161By issuing the
162.B I-1\en0\en
163command, a client will specify that he is using the VERSION 1 protocol.
164.IP
165For a VERSION 0 client, the
166.I operation
167parameter is the platform
168.B mt_op
169value (could be different if the client and the
170.B rmt
171server are on two different platforms). For a VERSION 1 client, the
172.I operation
173parameter is standardized as below:
174.RS
175.TP
176.B 0
177Issue a
178.B MTWEOF
179command (write
180.I count
181end-of-file records).
182.TP
183.B 1
184Issue a
185.B MTFSF
186command (forward space over
187.I count
188file marks).
189.TP
190.B 2
191Issue a
192.B MTBSF
193command (backward space over
194.I count
195file marks).
196.TP
197.B 3
198Issue a
199.B MTFSR
200command (forward space
201.I count
202inter-record gaps).
203.TP
204.B 4
205Issue a
206.B MTBSR
207command (backward space
208.I count
209inter-record gaps).
210.TP
211.B 5
212Issue a
213.B MTREW
214command (rewind).
215.TP
216.B 6
217Issue a
218.B MTOFFL
219command (rewind and put the drive offline).
220.TP
221.B 7
222Issue a
223.B MTNOP
224command (no operation, set status only).
225.RE
226.TP
227.B i\fIoperation\fR\en\fIcount\fR\en
228Perform an extended
229.B MTIOCOP
230.BR ioctl (2)
231command using the specified parameters. The parameters are interpreted as the
232.B ASCII
233representations of the decimal values to place in the
234.B mt_op
235and
236.B mt_count
237fields of the structure used in the
238.B ioctl
239call. The return value is the
240.I count
241parameter when the operation is successful. The possible operations are:
242.RS
243.TP
244.B 0
245Issue a
246.B MTCACHE
247command (switch cache on).
248.TP
249.B 1
250Issue a
251.B MTNOCACHE
252command (switch cache off).
253.TP
254.B 2
255Issue a
256.B MTRETEN
257command (retension the tape).
258.TP
259.B 3
260Issue a
261.B MTERASE
262command (erase the entire tape).
263.TP
264.B 4
265Issue a
266.B MTEOM
267command (position to end of media).
268.TP
269.B 5
270Issue a
271.B MTNBSF
272command (backward space count files to BOF).
273.RE
274.TP
275.B S
276Return the status of the open device, as obtained with a
277.B MTIOCGET
278.B ioctl
279call. If the operation was successful, an \*(lqack\*(rq is sent with the size
280of the status buffer, then the status buffer is sent (in binary, which is
281non-portable between different platforms).
282.TP
283.BI s sub-command
284This is a replacement for the previous
285.B S
286command, portable across different platforms. If the open device is a magnetic
287tape, return members of the magnetic tape status structure, as obtained with a
288.B MTIOCGET
289ioctl call. If the open device is not a magnetic tape, an error is returned. If
290the
291.B MTIOCGET
292operation was successful, the numerical value of the structure member is
293returned in decimal. The following sub commands are supported:
294.RS
295.TP
296.B T
297return the content of the structure member
298.B mt_type
299which contains the type of the magnetic tape device.
300.TP
301.B D
302return the content of the structure member
303.B mt_dsreg
304which contains the "drive status register".
305.TP
306.B E
307return the content of the structure member
308.B mt_erreg
309which contains the "error register". This structure member must be retrieved
310first because it is cleared after each
311.B MTIOCGET
312ioctl call.
313.TP
314.B R
315return the content of the structure member
316.B mt_resid
317which contains the residual count of the last I/O.
318.TP
319.B F
320return the content of the structure member
321.B mt_fileno
322which contains the file number of the current tape position.
323.TP
324.B B
325return the content of the structure member
326.B mt_blkno
327which contains the block number of the current tape position.
328.TP
329.B f
330return the content of the structure member
331.B mt_flags
332which contains MTF_ flags from the driver.
333.TP
334.B b
335return the content of the structure member
336.B mt_bf
337which contains the optimum blocking factor.
338.RE
339.PP
340Any other command causes
341.B rmt
342to exit.
343.SH DIAGNOSTICS
344All responses are of the form described above.
345.SH SEE ALSO
346.BR rcmd (3),
347.BR rexec (3),
348.I /usr/include/sys/mtio.h,
349.BR rdump (8),
350.BR rrestore (8)
351.SH BUGS
352People should be discouraged from using this for a remote file access protocol.
353.SH AUTHOR
354The
355.B dump/restore
356backup suit was ported to Linux's Second Extended File System by Remy Card
357<card@Linux.EU.Org>. He maintained the initial versions of
358.B dump
359(up and including 0.4b4, released in january 1997).
360.PP
361Starting with 0.4b5, the new maintainer is Stelian Pop <stelian@popies.net>.
362.SH AVAILABILITY
363The
364.B dump/restore
365backup suit is available from <http://dump.sourceforge.net>
366.SH HISTORY
367The
368.B rmt
369command appeared in 4.2BSD.