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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Performing file backups to another AIX server or Windows server

Status
Not open for further replies.

jjjtech

MIS
Sep 1, 2003
2
US
We have three systems using three different AIX boxes. All are currently performing their backups to DATs. I have an F30 that was taken out of service over a year ago with a clear AIX license on it (I think v4.3.3). What I would like to do is perform all of the backups on the AIX boxes currently in use to the old F30 or a Win2K server, whichever would be easier/quicker.
I tried something along this line a while ago. One of our vendors send the backup to a temp file while the application is offline, then brings the app back up and dumps the backup to DAT. So I did an FTP of this file to a Windows box. Since the file is anywhere from 3GB to 7.5GB the process took upwards to 20 hours to do. No good.
We are looking to eliminate the daily tape changes and still maintain data.
Any suggestions?
Thanks.
 
Hello,
we do the following for all our mksysb (6 serveurs) :
One server has a /backup filesystem that can be export by NFS on the other server. The others servers perform there mksysb on this Filesystem by mounting it with automount.
This is done really quickly (about +- 2 hour) and some of thi mksysb are greater than 2gb.
I can put the script i'm using for doing this... if you want!
 
Still going to have server network bandwitch time using NFS or Samba.
 
LeDam- I would love to see the script for this. Thanks.
dblair- most of our network it at least 100bit and a good share of that is being/has been upgraded to 1Gb. However there is always room for improvement. :)
 
Here you have :

#!/usr/bin/ksh
#------------------
#
# makesysbak
#
#-----------------
# description : Make a system backup (mksysb) of the system
# on /vol/backup ( NFS on backserv:/backup )
# remarks :
# history :
#
#==============

MAILUSER="root"
FILENAME=`basename $0`
HOST=`hostname`

BAKDIR=/vol/backup
APPLOG=/vol/backup/log

LOGFILE="$APPLOG/$FILENAME.$HOST.`date +%d%m%y`.`date +%H%M`.log"
touch $LOGFILE > /dev/null 2>&1

if [ $? -ne 0 ]
then
LOGFILE="/tmp/$FILENAME.$HOST.`date +%d%m%y`.`date +%H%M`.log"

echo "ERROR: Unable to create LOGFILE in $APPLOG ! \n writing to $LOGFILE instead..." | mail -s "$HOST: $FILENAME ERROR Unable to create LOGFILE" $MAILUSER

fi

exec 1>$LOGFILE 2>&1


#=======================================
# Functions
#=======================================

function mail_exit
{
# $1 = Mail subject
# $2 = Mail data
# $3 = exit code

echo "\nEntering mail_exit function\n"

echo "echo $2 | mail -s $1 $MAILUSER"

echo "$2" | mail -s "$1" "$MAILUSER"

exit $3
}


#===============
#
# Main function
#
#===============



echo "\n\n--------------------------------------------------------\n"
echo "STARTING SYSTEM BACKUP PROCEDURE - `date` \n"
echo "--------------------------------------------------------\n\n"


#
# Let's go
#
if [ $# -eq 1 -a "$1" = "tape" ]
then
#
# Control workstation - Backup up to tape
#
# Edit /etc/exclude.rootvg (exclude directories)
#
echo "This system is the Control Workstation"
echo "Proceeding to tape mksysb..."

# Check if tape is present
#
mt rewind
if [ $? -ne 0 ]
then
echo "\n\nNO TAPE IN DRIVE !!! Please insert a new tape.\n\n"
mail_exit "RS/6000 CWS $HOST system backup FAILED!" "NO TAPE IN DRIVE !!!\nBackup canceled !\n" 1
else
echo "Tape found in /dev/rmt0"

fi


# Check if tape is not a data tape
#
tar tf /dev/rmt0 > /dev/null 2>&1
if [ $? -eq 0 ]
then
echo "\nTAPE IS NOT EMPTY !!!"
echo "\n\nTape contains maybe DATA backup. Aborting system backup...\n\n"
echo "Please use a new tape or a tape that does not contain a tar backup\n"
mt offline
mail_exit "RS/6000 CWS $HOST system backup FAILED!" "TAPE IS NOT EMPRY !!!\nMay be wrong tape inserted\nBackup canceled !\n" 1
else
echo "Tape is not in tar format"

fi


# Proceed to system backup
#
echo "Starting system backup now"
mksysb -i -e /dev/rmt0

if [ $? -ne 0 ]
then
echo "\n\nA PROBLEM was encountered during system backup please check...\n"
mt offline
mail_exit "RS/6000 CWS $HOST system backup FAILED!" "nA PROBLEM was encountered during system backup\nPlease check logfile $APPLOG" 1
fi

echo "Eject tape"

mt offline

echo "\n\n`date` SYSTEM BACKUP SUCCESSFUL !!!\n\n\n"

mail_exit "RS/6000 CWS $HOST System backup completed" "All mounted filesystems of rootvg saved." 0

else
#
# other node - Backup up to /images (/vol/backup) on CWS
#

#
# Remove flag file
#
rm -f $APPLOG/bos.obj.${HOST}.successfull > /dev/null 2>&1


echo "This system is $HOST"

#
# Check if automounter is running and start it if not
echo "Check if automount is running"
ps -fe | grep automount | grep -v grep > /dev/null 2>&1
if [ $? -ne 0 ]
then
echo "Starting automount"
/usr/sbin/automount
if [ $? -ne 0 ]
then
echo "\n\nA PROBLEM was encountered starting AUTOMOUNTER, check log\n"
echo "Trying to continue anyway..."
fi
fi


echo "Check if $BAKDIR is available"
ls -l $BAKDIR > /dev/null 2>&1
if [ $? -ne 0 ]
then
echo "\n\nA PROBLEM was encountered mounting ../images from CWS, check log\n"
mail_exit "RS/6000 node $HOST System backup FAILED!" "A PROBLEM was encountered mounting ../images from CWS, check $APPLOG" 1
fi

VER="`oslevel | cut -d'.' -f1-3`"

echo "Proceeding to system backup $BAKDIR/bos.obj.${HOST}.$VER"

mksysb -i -e $BAKDIR/bos.obj.${HOST}.$VER

if [ $? -ne 0 ]
then
echo "\n\nA PROBLEM was encountered during system backup please check...\n"
mail_exit "RS/6000 $HOST system backup FAILED!" "A PROBLEM was encountered during system backup\nPlease check logfile $APPLOG" 1
fi

echo "\n\n`date` SYSTEM BACKUP SUCCESSFUL !!!\n\n\n"

touch $APPLOG/bos.obj.${HOST}.successfull
cp /image.data $BAKDIR/image.data.${HOST}
cp /bosinst.data $BAKDIR/bosinst.data.${HOST}

fi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top