Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mksysb help

Status
Not open for further replies.

chesterc

MIS
Mar 11, 2002
5
0
0
CA
Has anyone ever been successful making a mksysb backup on to a remote tape drive? I'm running AIX 4.3.3 on an IBM RS/6000. Any help, suggestion, tips would be greatly appreciated.
 
This obviously does you no good if you cannot hook a tape drive up to the remote system if you need to restore but...Try this script:

#!/bin/ksh
#
# @(#) Remote mksysb V1.00
# @(#) Updated for 4.3.3 12/03/2001 V1.02
#---------------------------------------------------------------------#
# Create a bootable tape while doing remote backups. #
#---------------------------------------------------------------------#
devck=`echo $2|cut -c1-5`
if [ "$devck" != "/dev/" ];then
echo &quot;Usage: rmksysb <remote_hostname> </dev/rmt#.1>&quot;
echo &quot;This should be run on the system that does NOT have a tape drive...&quot;
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 &quot;The remote system requires an entry in the .rhosts file if you\c&quot;
echo &quot; want to use \nthe tape drive!!!&quot;;exit
else
echo &quot;Permission to use $REMOTEH granted...&quot;
fi
#
echo &quot;Remote host is $REMOTEH Remote device is $REMOTET&quot;
echo &quot;Creating bootable tape...&quot;

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

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

rsh ${REMOTEH} &quot;echo 'Dummy TOC' | /bin/dd of=${REMOTET} bs=512 conv=sync&quot;
rsh ${REMOTEH} &quot;/usr/lib/methods/chggen -l ${REMOTET} -a block_size=1024&quot;
#---------------------------------------------------------------------#
# Create a local pipe and connect it to the remote tape drive. #
#---------------------------------------------------------------------#
echo &quot;Creating the local pipe and connecting to remote tape drive.&quot;
rm -f ${PIPE} 2>/dev/null
/usr/sbin/mknod ${PIPE} p
cat ${PIPE} | rsh ${REMOTEH} &quot;/bin/dd of=${REMOTET} obs=100b 2>/dev/null&quot; &
#---------------------------------------------------------------------#
# Generate the local /.image.data file. #
#---------------------------------------------------------------------#
/usr/bin/mkszfile
#---------------------------------------------------------------------#
# Start the local backup. #
#---------------------------------------------------------------------#
echo &quot;Starting remote mksysb on ${REMOTET}...&quot;
/usr/bin/mksysb -e -i -p -b 1024 ${PIPE}
rsh ${REMOTEH} &quot;/bin/tctl -f ${REMOTET} rewind&quot;
echo &quot;\n\tDone....\n&quot;
exit 0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top