AIX Tip of the Week

AIX Tip of the Week: Accesing Remote Tape Drives

Audience: AIX Users and Administrators

Date: April 1999

One of the advantages of UNIX is the ability to share remote devices, such as tape drives. The "rdump/rrestore" commands can be used to backup/restore files to a tape drive on a remote system. However, because these commands require a ".rhost" file, many people consider them a security exposure.

One alternative is to use the more secure "rexec" command which prompts for a user id/password. The following example illustrates how to use the "rexec" command to access remote tape drives. In this example, the "tape_host" is the TCP-IP hostname of the system with the tape drive, and the "data_host" is the system where the files reside. The example also assumes you have a valid user id/password on both systems.

To create a backup to a remote system with a tape, issue the following command from the "data_host."

tar -cvf - * | dd bs=1k | rexec tape_host "dd bs=1k of=/dev/rmt0"

To restore this tape, issue the following command from the "tape_host" system.

dd bs=1k if=/dev/rmt0 | rexec data_host "dd bs=1k | tar -xvf-"

The general concept illustrated above can be extended to other remote devices such as diskettes, CD-ROMs and disk drives.