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