.\" Copyright (c) 1983 Regents of the University of California. .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" .\" @(#)rmt.8c 6.1 (Berkeley) 4/27/85 .\" .TH RMT 8 "April 27, 1985" .UC 5 .SH NAME rmt \- remote magtape protocol module .SH SYNOPSIS .B /etc/rmt .SH DESCRIPTION .B Rmt is a program used by the remote dump and restore programs in manipulating a magnetic tape drive through an interprocess communication connection. .B Rmt is normally started up with an .BR rexec (3) or .BR rcmd (3) call. .PP The .B rmt program accepts requests specific to the manipulation of magnetic tapes, performs the commands, then responds with a status indication. All responses are in ASCII and in one of two forms. Successful commands have responses of .PP .ti +0.5i \fBA\fInumber\fR\en .PP where .I number is an ASCII representation of a decimal number. Unsuccessful commands are responded to with .PP .ti +0.5i \fBE\fIerror-number\fR\en\fIerror-message\fR\en, .PP where .I error-number is one of the possible error numbers described in .BR intro (2) and .I error-message is the corresponding error string as printed from a call to .BR perror (3). The protocol is comprised of the following commands (a space is present between each token). .TP 15 .B O device mode Open the specified .I device using the indicated .IR mode . .I Device is a full pathname and .I mode is an ASCII representation of a decimal number suitable for passing to .BR open (2). If a device had already been opened, it is closed before a new open is performed. .TP 15 .B C device Close the currently open device. The .I device specified is ignored. .TP 15 .B L whence offset Perform an .BR lseek (2) operation using the specified parameters. The response value is that returned from the .I lseek call. .TP 15 .B W count Write data onto the open device. .B Rmt reads .I count bytes from the connection, aborting if a premature end-of-file is encountered. The response value is that returned from the .BR write (2) call. .TP 15 .B R count Read .I count bytes of data from the open device. If .I count exceeds the size of the data buffer (10 kilobytes), it is truncated to the data buffer size. .B Rmt then performs the requested .BR read (2) and responds with \fBA\fIcount-read\fR\en if the read was successful; otherwise an error in the standard format is returned. If the read was successful, the data read is then sent. .TP 15 .B I operation count Perform a MTIOCTOP .BR ioctl (2) command using the specified parameters. The parameters are interpreted as the ASCII representations of the decimal values to place in the .I mt_op and .I mt_count fields of the structure used in the .B ioctl call. The return value is the .I count parameter when the operation is successful. .TP 15 .B S Return the status of the open device, as obtained with a MTIOCGET .B ioctl call. If the operation was successful, an ``ack'' is sent with the size of the status buffer, then the status buffer is sent (in binary). .PP Any other command causes .B rmt to exit. .SH DIAGNOSTICS All responses are of the form described above. .SH "SEE ALSO" .BR rcmd (3), .BR rexec (3), .BR mtio (4), .BR rdump (8), .BR rrestore (8). .SH BUGS People tempted to use this for a remote file access protocol are discouraged. .PP Minix-vmd doesn't have the .BR dump (8) and .BR restore (8) programs yet, but thanks to .B rmt you can use a tape drive attached to a Minix-vmd system remotely.