[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 4


rmt Command

Purpose

Allows remote access to magnetic tape devices.

Syntax

rmt

Description

The rmt command allows remote access to magnetic tape devices. The remote dump and restore programs use the rmt command as a remote magnetic tape protocol module. The rmt command is normally started with a rexec or rcmd subroutine.

The rmt command accepts requests specific to the manipulation of magnetic tapes, performs the commands, and then responds with a status indication. All responses are in ASCII and in one of two forms. Successful commands receive responses of Axxx, where xxx is an ASCII representation of a decimal number. Unsuccessful commands receive responses of Eyyy error-message, where yyy is one of the possible error numbers described in the errno.h file and error-message is the corresponding error string as printed from a call to the perror subroutine. The protocol is comprised of the following subcommands.

Subcommands


ODeviceMode Opens the device specified by the Device parameter using the mode indicated by the Mode parameter. The value of the Device parameter is a full path name, and that of the Mode parameter is an ASCII representation of a decimal number suitable for passing to the open subroutine. An open device is closed before a new open operation is performed.
CDevice Closes the open device. The device specified with the Device parameter is ignored.
LWhenceOffset Performs an lseek operation using the specified parameters. The lseek subroutine returns the response value.
WCount Writes data onto the open device. From the connection, the rmt command reads the number of bytes specified by the Count parameter, ending if a premature end-of-file is encountered. The write subroutine returns the response value.
RCount Reads, from the open device, the number of bytes of data specified by the Count parameter. The rmt command then performs the requested read operation and responds with Azzz, where zzz is the number of bytes read if the operation was successful. The data read is then sent. Otherwise, an error in the standard format is returned.
IOperationCount Performs an STIOCTOP ioctl subroutine using the specified parameters. The parameters are interpreted as the ASCII representations of the decimal values to place in the mt op and mt count fields of the structure used in the ioctl subroutine. The return value is the value of the Count parameter when the operation is successful.

Any other subcommand causes the rmt command to exit.

Note: For the R and W subcommands, if the Count parameter specifies more bytes than the connection can handle, the data will be truncated to a size that can be handled.

Exit Status

This command returns the following exit values:

0 Successful completion.
>0 An error occurred.

Files


/usr/sbin/rmt Contains the rmt command.
/usr/include/sys/errno.h Describes the possible error numbers.

Related Information

The rdump command, rrestore command.

The rexec subroutine.

The rmt special file.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]