How can I make an exact duplicate of a tape over the network?

How can I make an exact duplicate of a tape over the network?

The challenge here is not to have to create a temporary file (disk space
limitation) and work across heterogeneous networks.

This script might work:

LOCAL=/dev/tape_dev
REMOTE=/dev/tape_dev
dd if=$LOCAL ibs=64k obs=512 | rsh remote_host dd ibs=512 obs=64k of=$REMOTE


From: pack@acd.ucar.edu (Daniel Packman)

Daniel provides the following perl script to convert from the known
world's function codes to AIX for compatibility.

#!/bin/perl
# Wrapper to convert input rmt requests to
# AIX 3.2 ioctl numbers. We pass on all commands we don't understand
# I0 MTWEOF -> I10 STWEOF write and end-of-file record
# I1 MTFSF -> I11 STFSF forward space file
# I2 MTBSF -> I12 STRSF reverse space file
# I3 MTFSR -> I13 STFSR forward space record
# I4 MTBSR -> I14 STRSR reverse space record
# I5 MTREW -> I6 STREW rewind
# I6 MTOFFL -> I5 STOFFL rewind and unload tape
# I7 MTNOP -> I0 (no-op? should ignore following count)
# I8 MTRETEN-> I8 STRETEN retension tape, leave at load point
# I9 MTERASE-> I7 STERASE erase tape, leave at load point
#I10 MTEOM (position to end of media ... no ibm equivalent?)
#I11 MTNBSF (backward space file to BOF ... no ibm equivalent?)
@iocs = (10,11,12,13,14,6,5,0,8,7);
open(RMT,"|/usr/sbin/rmt") || die "Can't open pipe to rmt\n";
select(RMT);
$| = 1;
while () {
s/(^I)(\d$)/I$iocs[$2]/;
exit 0 if $_ =~ /^[Qq]/;
print RMT $_ ; }
exit 0;



Home FAQ