Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Remote mksysb

85 views
Skip to first unread message

Thomas Hadley - Computer Services

unread,
Jan 13, 1994, 9:36:49 AM1/13/94
to
I have looked over the aix FAQ and cannot find a command to perform a mksysb
command on a remote machine using the local 8mm tape drive. Can anyone help?

Configuration

Local Machine:
IBM RS6000/580
128mb RAM
12gb Disk
8mm 5gb Tape

Remote Machine:
IBMRS6000/340
32mb RAM
2.5gb Disk


Thanks!

--
+-------------------------------------+----------------------------------------+
| Thomas Hadley | Voice: (303) 491-1231 |
| System Administrator | Fax: (303) 491-4414 |
| | Fax: (303) 491-1205 |
| Colorado State University | E-Mail: tha...@vth1.vth.colostate.edu |
| Veterinary Teaching Hospital +----------------------------------------+
| 300 West Drake | |
| Fort Collins, Colorado 80523 | |
+-------------------------------------+----------------------------------------+

E Andrew Mondore

unread,
Jan 13, 1994, 10:49:27 AM1/13/94
to

The following script for remote mksysb was posted on the newsgroup a few months
ago. Here it is again (note -- I'm not the author of this, just a satisfied
user).

#!/bin/ksh
#
# @(#) Remote mksysb V1.00
#
#---------------------------------------------------------------------#
# Create a bootable tape while doing remote backups. #
#---------------------------------------------------------------------#
devck=`echo $2|cut -c1-5`
if [ "$devck" != "/dev/" ];then
echo "Usage: rmksysb <remote_hostname> </dev/rmt0.1>"
echo "This should be run on the system that don't have the tape drive..."
exit
fi

REMOTEH=$1 # Remote host for backup
REMOTET=$2 # Remote tape for backup
#
# Check the remote system to determine if .rhost file has an entry for this
# system.
#
rsh $REMOTEH date > /dev/null
if [ $? -ne 0 ] ; then
echo "The remote system requires an entry in the .rhosts file if you\c"
echo " want to use \nthe tape drive!!!";exit
else
echo "Permission to use $REMOTEH granted..."
fi
#
echo "Remote host is $REMOTEH Remote device is $REMOTET"
echo "Creating bootable tape..."

PIPE="/tmp/.fs.size" # Filename of the pipe
#---------------------------------------------------------------------#
# Rewind the tape and fix the blocksize. #
#---------------------------------------------------------------------#
echo "Rewinding tape and fixing blocksize."
rsh ${REMOTEH} "tctl -f ${REMOTET} rewind"
rsh ${REMOTEH} "/usr/lib/methods/chggen -l ${REMOTET} -a block_size=512"
#---------------------------------------------------------------------#
# Create the first 3 files on tape. #
#---------------------------------------------------------------------#
echo "Creating the first 3 files on the tape..."
MYPATH="/usr/ucb:/bin:/usr/bin:/etc:/usr/sbin:/usr/bin/X11:/usr/local/bin"
rsh ${REMOTEH} \
-n exec /bin/sh -c \
"'PATH=\"$MYPATH\";export PATH; \
exec /bin/bosboot -d ${REMOTET} -a'"

rsh ${REMOTEH} \
-n exec /bin/sh -c \
"'PATH=\"$MYPATH\";export PATH; \
exec /usr/sbin/mkinsttape ${REMOTET}'"

rsh ${REMOTEH} "echo 'Dummy TOC' | /bin/dd of=${REMOTET} bs=512 conv=sync"
rsh ${REMOTEH} "/usr/lib/methods/chggen -l ${REMOTET} -a block_size=1024"
#---------------------------------------------------------------------#
# Create a local pipe and connect it to the remote tape drive. #
#---------------------------------------------------------------------#
echo "Creating the local pipe and connecting to remote tape drive."
rm -f ${PIPE} 2>/dev/null
/etc/mknod ${PIPE} p
cat ${PIPE} | rsh ${REMOTEH} "/bin/dd of=${REMOTET} obs=100b 2>/dev/null" &
#---------------------------------------------------------------------#
# Generate the local /.fs.size file. #
#---------------------------------------------------------------------#
/bin/mkszfile
#---------------------------------------------------------------------#
# Start the local backup. #
#---------------------------------------------------------------------#
echo "Starting the local backup..."
/bin/mksysb ${PIPE}
sleep 120
rsh ${REMOTEH} "/bin/tctl -f ${REMOTET} rewind"
echo "\n\tDone....\n"
exit 0

================================================================================

Run the script on the machine that does not have the tape drive. On the host
that has the tape drive, you'll need a .rhosts file or /etc/hosts.equiv file
so the remote machine can use the local tape drive and run the rsh commands.

To run remote mksysb, use the following command:

rmksysb <hostname> /dev/rmt0

where <hostname> is the name of the host with the tape drive. Of course, use
the appropriate device name for the tape drive you want to access.
--
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
E. Andrew Mondore Internet: mon...@rpi.edu
Systems Programmer Bitnet: user...@rpitsmts.bitnet
Rensselaer Polytechnic Institute

Mickey Coggins

unread,
Jan 14, 1994, 7:51:38 AM1/14/94
to
You may want to modify this script slightly as I show below.
Doing a mksysb with an incompatible level on the local and
remote systems could cause problems.

..


REMOTEH=$1 # Remote host for backup
REMOTET=$2 # Remote tape for backup
#
# Check the remote system to determine if .rhost file has an entry for this

# system. Also, verify the two machines are on the same PTF level.
#
RESULT=`rsh $REMOTEH sum /unix`


if [ $? -ne 0 ] ; then
echo "The remote system requires an entry in the .rhosts file if you\c"
echo " want to use \nthe tape drive!!!";exit
else

if [ "$RESULT" = "`sum /unix`" ] ; then


echo "Permission to use $REMOTEH granted..."

else
echo "Attention: the kernels on the remote and local systems"
echo "do not match. This _could_ cause your mksysb tape to fail."
fi


fi
#
echo "Remote host is $REMOTEH Remote device is $REMOTET"

..

--
Mickey Coggins Mickey_...@vnet.ibm.com or mi...@oahu.cern.ch
'61 Body +41-1-436-7274 or +41-1-436-8525 (fax)
'93 RM125 Hohlstrasse 560, CH-8048 Zurich, Switzerland
_______________
"All who have meditated on the art of governing mankind have been convinced
that the fate of empires depends on the education of youth." -Aristotle

0 new messages