Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

comp.unix.aix Frequently Asked Questions (Part 5 of 5)
Section - 8.06: How do I do remote backup? (cont.)

( Part1 - Part2 - Part3 - Part4 - Part5 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Sex offenders ]


Top Document: comp.unix.aix Frequently Asked Questions (Part 5 of 5)
Previous Document: 8.06: How do I do remote backup?
Next Document: 8.07: How to configure dialup SLIP
See reader questions & answers on this topic! - Help others by sharing your knowledge

#!/bin/ksh
#######################################################################
#     rmksysb                                                         #
#######################################################################
#                                                                     #
# Description:                                                        #
#       creates a bootable mksysb backup of a remote system running   #
#	AIX 3.x or lists the Table of Contents of the current tape    #
#                                                                     #
# Usage:                                                              #
#       ./rmksysb $1 [$2] 					      #
#		$1 - remote host to be backed up		      #
#		$2 - optional: local tape device (default: rmt0)      #
#	or:							      #	
#	./rmksysb -l [$2]                                             #
#		to list Table of Contents saveset on tape in $2	      #
#		(only useful on tapes created by rmksysb)	      #
#                                                                     #
# Output:                                                             #
#       a bootable mksysb of the remote system                        #
#	or a listing of the TOC saveset on the current tape	      #
#                                                                     #
# Remarks:							      #
#	. rmksysb can only be used by root			      #	
#	. this script will use tapedevice .1, so if 	  	      #
#	  a >2.3GB drive is used: check density_set_1	              #
#	. the remote host needs /.rhosts to include the local host    #
#	  for root access (+ shell enabled in /etc/inetd.conf)        #	
#	. you will need some room (>1.5MB) on /tmp on the remote host #
#	  for standard mksysb .archive.list.* etc.		      #
#	. remote standard output & standard error (except dd/chdev)   #
#	  will go to local stdout & stderr			      #
#	. redirecting stdout can create quite large log-files (2MB)   #
#	. AIX versions should not be too far apart as the boot-saveset#
#	  comes from the local system & the rest from the remote      #
#	  (tested on AIX 3.2.5, AIX 4+ definitely won't work!!!)      #
#	. most likely this script will fail with multi-tape mksysb's: #
#	  another incentive to keep rootvg as small as possible!      #
#								      #
# Author:							      #
#	Henk van Doorn						      #
#	Email: hvdoorn@xs4all.nl       				      #
#								      #
#	Thanks to all who contributed. Esp. Paul Wynn (AIXpert '93),  #
#	my colleagues Dominic Dinardo & Douwe van Terwisga	      #
#	+ the input from Usenet were stimulating; thanks folks!	      #
#	I would welcome any additions & changes for the better...     # 
#                                                                     #
#######################################################################
#         CHANGES                                                     #
#######################################################################
#                                                                     #
# ID	 WHO   DATE                        DESCR                      #
# --	 ---   -------  --------------------------------------------- #
# X000	 HvD   6Jan95   Created this file.                            #
# X001	 HvD   2Feb95   Final version                                 #
#######################################################################

set +u

# Global variable definitions.
UMASK=`umask`
BLK_SZ=1024
BOOT_BLK_SZ=512
HOST=${1}

# TAPE = $2 with /dev/ & .* removed, defaulting to rmt0
TAPE=${2:-rmt0}
TAPE=${TAPE#/dev/}
TAPE=${TAPE%.*}

usage()
{
    echo "Usage: ./rmksysb <remote_host_name> [<tape_device>] or" >&2
    echo "       ./rmksysb -l [<tape_device>]" >&2
    echo "                 with <tape_device>= e.g. rmt1" >&2
    echo "Default <tape_device>=rmt0" >&2
    return
}

check_parms()
{
if [ "${HOST}" = "" ]
then
	usage
	exit 1
fi

if [ "${HOST}" = "-l" ]
then
# show TOC block which contains some backup details on rmksysb tapes
	get_tape_block_size
	chdev -l ${TAPE} -a block_size=${BOOT_BLK_SZ} >/dev/null 2>&1
	mt -f /dev/${TAPE} rewind
	mt -f /dev/${TAPE}.1 fsf 2
	dd if=/dev/${TAPE} count=1 2>/dev/null
	chdev -l ${TAPE} -a block_size=${OLD_BLK_SZ} >/dev/null 2>&1
	exit 
fi
}

check_host()
{
rsh ${HOST} hostname >/dev/null 2>&1
if [ $? -ne 0 ]
then
	echo "Check hostname & rsh access" >&2
	exit 1
fi
}

get_tape_block_size()
{
VALID=
`lsdev -Cc tape | cut -f1 -d" " | grep ${TAPE} 2>&1 >/dev/null` && 
	{
        OLD_BLK_SZ=`lsattr -El ${TAPE} -a block_size | cut -f2 -d" "`
        VALID=true
        }

if  [ "$VALID" = "" ]
then
	echo "Tape drive $TAPE is not a valid local drive!" >&2
	exit 1
fi
}

#
# The main procedure is analogous to its C counterpart,
# This is the basic driver routine.
#
main()
{

if [ "`id | grep 'uid=0'`" = "" ]
then 
	echo "rmksysb can only be run as root!" >&2
	exit 2 
fi
umask 022

check_parms
check_host
get_tape_block_size

# display some info on this rmksysb session
echo "`date`\n\nRemote System Backup from remote ${HOST} to local `hostname` on device:\n`lscfg -v -l ${TAPE} | sed -n '3,6p' | grep "[a-z]" `\n" 

# Here the action starts
rsh $HOST -n /usr/bin/mkszfile
rsh $HOST -n "echo ${BLK_SZ} > /tapeblksz"

rsh $HOST -n "rm -f /tmp/pipe.rmksysb"
rsh $HOST -n "rm -f /tmp/pipe.rmksysb.out"
rsh $HOST -n "rm -f /tmp/pipe.rmksysb.err"

rsh $HOST -n "/etc/mknod /tmp/pipe.rmksysb p"
rsh $HOST -n "/etc/mknod /tmp/pipe.rmksysb.out p"
rsh $HOST -n "/etc/mknod /tmp/pipe.rmksysb.err p"

# create remote startup file for mkinsttape
rsh $HOST -n "echo '#!/bin/ksh\nexport PATH=$PATH ; /usr/sbin/mkinsttape /tmp/pipe.rmksysb >/tmp/pipe.rmksysb.out 2>/tmp/pipe.rmksysb.err &' > /tmp/mkinsttape.start "
rsh $HOST -n "chmod 700 /tmp/mkinsttape.start"

chdev -l $TAPE -a block_size=${BOOT_BLK_SZ} >/dev/null 2>&1
tctl -f /dev/${TAPE} retension

echo
echo
echo ">>> SAVESET 1: BOS boot image from `hostname`"
echo
bosboot -d /dev/${TAPE}.1 -a 

echo
echo
echo ">>> SAVESET 2: BOS install utilities from ${HOST} (backup format)"
echo
rsh $HOST -n "nohup /tmp/mkinsttape.start" &

# get remote standard out & err to local stdout & err
rsh $HOST -n "dd if=/tmp/pipe.rmksysb.out 2>/dev/null" | dd 2>/dev/null &
rsh $HOST -n "dd if=/tmp/pipe.rmksysb.err 2>/dev/null" | ( dd 2>/dev/null ) >&2 &

# get remote mkinsttape to local tape device
rsh $HOST -n "dd if=/tmp/pipe.rmksysb 2>/dev/null" | dd 2>/dev/null | dd of=/dev/${TAPE}.1 conv=sync 2>/dev/null

echo
echo
echo ">>> SAVESET 3: Backup information (list with ./rmksysb -l [<tapedevice>])"
echo
# add dummy TOC to tape with some backup information
echo "`date`\n\nRemote System Backup from remote ${HOST} to local `hostname` on device:\n`lscfg -v -l ${TAPE} | sed -n '3,6p' | grep "[a-z]" `\n" | dd of=/dev/${TAPE}.1 conv=sync 2>/dev/null

# change blocksize to 1024 for better performance
chdev -l ${TAPE} -a block_size=${BLK_SZ} >/dev/null 2>&1

# rewind & skip first 3 savesets
mt -f /dev/${TAPE} rewind
mt -f /dev/${TAPE}.1 fsf 3

echo
echo
echo ">>> SAVESET 4: mksysb (rootvg backup) from ${HOST} (tar format)"
echo
# start the actual remote mksysb
echo "The contents of the /.fs.size file on ${HOST} are:"
rsh $HOST -n "cat /.fs.size"
echo

rsh $HOST -n "nohup /usr/bin/mksysb /tmp/pipe.rmksysb >/tmp/pipe.rmksysb.out 2>/tmp/pipe.rmksysb.err &" &

# get remote standard out & err to local stdout
rsh $HOST -n "dd if=/tmp/pipe.rmksysb.out 2>/dev/null" | dd 2>/dev/null &
rsh $HOST -n "dd if=/tmp/pipe.rmksysb.err 2>/dev/null" | ( dd 2>/dev/null ) >&2 &
 
# get remote mksysb to local tape device
rsh $HOST -n "dd if=/tmp/pipe.rmksysb 2>/dev/null" | dd obs=${BLK_SZ} 2>/dev/null | dd of=/dev/${TAPE} bs=${BLK_SZ} conv=sync 2>/dev/null

# cleaning up
rsh $HOST -n "rm -f /tmp/pipe.rmksysb"
rsh $HOST -n "rm -f /tmp/pipe.rmksysb.out"
rsh $HOST -n "rm -f /tmp/pipe.rmksysb.err"
rsh $HOST -n "rm -f /tmp/mkinsttape.start"

chdev -l ${TAPE} -a block_size=${OLD_BLK_SZ} >/dev/null 2>&1
umask $UMASK

# display some closing info on this rmksysb session
echo "Remote System Backup from remote ${HOST} to local `hostname` is finished.\n`date`\n" 

} #end of main

# Call the driver
main 


User Contributions:

But remnants' crop burning hits harvesting hard

This sunday, quite possibly 28, 2019 snapshot, Provided by the city service group, jointly for Jarniyah, contains been authenticated based on its contents and other AP reporting, Shows Syrians lifetime extinguish a fire in a field of crops, wearing Jaabar, Raqqa state, Syria. Thousands of acres of wheat and barley fields in both Syria and Iraq have been scorched by the fires within harvest season, that typically runs until mid June. "The life that we live here is already bitter, " stated Hussain Attiya, A farmer from Topzawa Kakayi in upper Iraq. "If the outcome continues like this, I would say that no one will continue to be here. I plant 500 to 600 acres on a yearly basis. still, I won't be able to do that because I can't stay here and guard the land day and night. "ISIS militants have a history of working with a "Scorched earth insurance coverage " In areas from that they can retreat or where they are defeated. Ahmed al Hashloum thoughts Inmaa, Arabic for benefits, A local civil group that supports farming. all it takes is a cigarette butt to set haystacks on fire, He brought up. Said the fires are threatening to disrupt normal food production cycles and potentially reduce food to protect months to come. The crop burning remains localized and can't be compared to pre war devastation, Beals considered that. "suffice to say, It is only the beginning of the summer and if the fires continue it could lead to a crisis, " Beals recounted,AlternativeHeadline,prepared crop burning blamed on ISIS remnants compounds misery in war torn Iraq and Syria"}

But good news is short lived in this part of the world, Where residents of the two countries struggle to face seemingly never ending violence and turmoil amid Syria's civil war and attacks by remnants of the Islamic State of Iraq and Syria (ISIS) social groups. of course, Even in locations where conflict has subsided, Fires currently raging in farmers' fields, depriving them of valuable crops.

The blazes have been blamed also consider on defeated ISIS militants seeking to avenge their losses, Or on Syrian regime forces battling to rout other armed groups. Thousands of acres of wheat and barley fields in both Syria and Iraq have been scorched by the fires within harvest season, what kind runs until mid June.

ISIS militants have a history of implementing a "Scorched earth guideline" In areas from which retreat or where they are defeated. this "A means of inflicting a collective punishment on those put aside, said Emma Beals, a completely independent Syria researcher.

ISIS militants claimed obligations for burning crops in their weekly newsletter, al Nabaa, Saying they targeted farms owned by senior officials in six Iraqi provinces and in Kurdish administered eastern Syria, sending the persistent threat from the group even after its territorial defeat.

ISIS said it burned the farms of "The apostates in Iraq together with the Levant" And required more.

"It seems that it'll be a hot summer that will burn the pockets of the apostates as well as their hearts as they burned the Muslims and their homes in the past years, this great article said.

countless acres of wheat fields around Kirkuk in northern Iraq were set on fire. Several wheat fields in the Daquq district in southern Kirkuk burned for three days straight yesterday.

In eastern Syria's Raqqa state, Farmers battled raging fires with items of cloth, bags and water trucks. Piles of hay burned and black smoke billowed above the job areas.

The Syrian Observatory for Human Rights said through 74,000 acres (30,000 hectares) linked farmland in Hassakeh, Raqqa and completely to Aleppo province to the west, Were scorched.

Activist Omar Abou Layla said local Kurdish led forces failed to react to the fires in the province of Deir el Zour, Where ISIS was uprooted from its last property in March, (...)

Comment about this article, ask questions, or add new information about this topic:




Top Document: comp.unix.aix Frequently Asked Questions (Part 5 of 5)
Previous Document: 8.06: How do I do remote backup?
Next Document: 8.07: How to configure dialup SLIP

Part1 - Part2 - Part3 - Part4 - Part5 - Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
bofh@mail.teleweb.pt (Jose Pina Coelho)





Last Update March 27 2014 @ 02:11 PM