summaryrefslogtreecommitdiff
path: root/doc/rmt.8
blob: 7550277179089e677abbbdfb33e331d53089dc40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
.\" This file is part of GNU tar. -*- nroff -*-
.\" Copyright 2013 Free Software Foundation, Inc.
.\"
.\" GNU tar is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 3 of the License, or
.\" (at your option) any later version.
.\"
.\" GNU tar is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
.TH RMT 1 "January 27, 2014" "RMT" "GNU TAR Manual"
.SH NAME
rmt \- remote magnetic tape server
.SH SYNOPSIS
.B rmt
.SH DESCRIPTION
.B Rmt
provides remote access to files and devices for
.BR tar (1),
.BR cpio (1),
and similar backup utilities.  It is normally called by running
.BR rsh (1)
or
.BR ssh (1)
to the remote machine, optionally using a different
login name if one is supplied.
.PP
The calling program communicates with
.B rmt
by sending requests on its standard input and reading replies from the
standard output.  A request consists of a request letter followed by
an argument (if required) and a newline character.  Additional data,
if any, are sent after the newline.  On success,
.B rmt
returns
.PP
.in +4
.BI A number \en
.PP
where \fInumber\fR is an ASCII representation of a decimal return
code.  Additional data are returned after this line.  On error, the
following response is returned:
.PP
.in +4
.BI E errno \en error-message \en
.PP
where \fIerrno\fR is one of the system error codes, as described in
.BR errno (3),
and \fIerror-message\fR is a one-line human-readable description of
the error, as printed by
.BR perror (3).
.PP
Available commands and possible responses are discussed in detail in
the subsequent section.
.SH COMMANDS
.TP
.BI O device \en flags \en
Opens the \fIdevice\fR with given \fIflags\fR. If a
device had already been opened, it is closed before opening the new one.
.sp
.B Arguments
.RS
.TP
.I device
The name of the device to open.
.TP
.I flags
Flags for
.BR open (2):
a decimal number, or any valid \fBO_*\fR constant from
.B fcntl.h
(the initial \fBO_\fR may be omitted), or a bitwise or (using \fB|\fR)
of any number of these, e.g.:
.in +4
.EX
576
64|512
CREAT|TRUNC
.EE
.RS
In addition, a combined form is also allowed, i.e. a decimal mode followed
by its symbolic representation.  In this case the symbolic representation
is given preference.
.RE
.sp
.B Reply
.RS
.B A0\en
on success.
.RE
.sp
.B Extensions
.RS
BSD version allows only decimal number as \fIflags\fR.
.RE 1
.TP
\fBC\fR[\fIdevice\fR]\fB\en\fR
Close the currently open device.
.RS
.TP
.B Arguments
.br
Any arguments are silently ignored.
.TP
.B Reply
.br
.B A0\en
on success.
.RE
.TP
.BI L whence \en offset \en
.RS
Performs an
.BR lseek (2)
on the currently open device with the specified
parameters.
.TP
.B Arguments
.RS
.TP
.I whence
Where to measure offset from. Valid values are:
.sp
.nf
.ta 1n 20n
	0, SET, SEEK_SET	seek from the file beginning
	1, CUR, SEEK_CUR	seek from the current location
	2, END, SEEK_END	seek from the file end
.fi
.RE
.TP
.B Reply
.br
.BI A offset \en
on success. The \fIoffset\fR is the new offset in file.
.TP
.B Extensions
BSD version allows only 0,1,2 as \fIwhence\fR.
.RE
.TP
.BI R count \en
.br
Read \fIcount\fR bytes of data from the current device.
.RS
.TP
.B Arguments
.RS
.TP
.I count
number of bytes to read.
.RE
.TP
.B Reply
.br
On success:
.sp
.in +4
.BI A rdcount \en
.in
.sp
followed by \fIrdcount\fR bytes of data read from the device.
.RE
.TP
.BI W count \en
Writes data onto the current device.  The command is followed by
\fIcount\fR bytes of input data.
.RS
.TP
.B Arguments
.RS
.TP
.I count
Number of bytes to write.
.RE
.TP
.B Reply
.br
On success: \fBA\fIwrcount\fB\en\fR, where \fIwrcount\fR is the number of
bytes actually written.
.RE
.TP
.BI I opcode \en count \en
Perform a
.B MTIOCOP
.BR ioctl (2)
command with the specified paramedters.
.RS
.TP
.B Arguments
.RS
.TP
.I opcode
.B MTIOCOP
operation code.
.TP
.I count
mt_count.
.RE
.TP
.B Reply
.br
On success: \fBA0\en\fR.
.RE
.TP
.B S\en
Returns the status of the currently open device, as obtained from a
.B MTIOCGET
.BR ioctl (2)
call.
.RS
.TP
.B Arguments
.br
None
.TP
.B Reply
.br
On success: \fBA\fIcount\fB\en\fR followed by \fIcount\fR bytes of
data.
.RE
.SH "SEE ALSO"
.BR tar (1).
.SH BUGS
Using this utility as a general-purpose remote file access tool is
discouraged.
.SH "BUG REPORTS"
Report bugs to <bug\-tar@gnu.org>.
.SH HISTORY
The
.B rmt
command appeared in 4.2BSD.  The GNU
.BR rmt
is written from scratch, using the BSD specification.
.SH COPYRIGHT
Copyright \(co 2013 Free Software Foundation, Inc.
.br
.na
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
.br
.ad
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.\" Local variables:
.\" eval: (add-hook 'write-file-hooks 'time-stamp)
.\" time-stamp-start: ".TH [A-Z_][A-Z0-9_.\\-]* [0-9] \""
.\" time-stamp-format: "%:B %:d, %:y"
.\" time-stamp-end: "\""
.\" time-stamp-line-limit: 20
.\" end: