Mt Xia: Technical Consulting Group

Business Continuity / Disaster Recovery / High Availability
Data Center Automation / Audit Response / Audit Compliance

-
Current Location
-

css
  GlobalSysAdmin
    AIX

-

digg Digg this page
del.icio.us Post to del.icio.us
Slashdot Slashdot it!


Business Web Site Hosting
$3.99 / month includes Tools,
Shopping Cart, Site Builder

www.siteox.com

FREE Domain Registration
included with Web Site Hosting
Tools, Social Networking, Blog

www.siteox.com

Script Source Code for "cimage_migrate.ksh.orig"

This document contains the source code for the Disaster Recovery script "cimage_migrate.ksh.orig".



#!/bin/ksh

#### 
#### Check the time of day
#### If it is 1700 or later then schedule the script to begin execution
#### the next day at 0500
####  

if [[ `date +%H` -gt 16 ]]

	then
		echo /usr/local/scripts/cimage_migrate.ksh | at 5:00 am tomorrow
fi
#### 
#### Check to see if the COUNTER control file exists
#### If if exists, then user the value inside the COUNTER control file
#### If it does not exits, default to a COUNTER value of 10
#### 

if [[ -f /usr/local/scripts/counter ]]
	
	then
		count=`cat /usr/local/scripts/counter`

	else
		count=11
fi

# If the COUNTER value is less that 100 then execute the following lines

#if [[ ${count} -lt 100 ]]

while [[ ${count} -lt 100 ]]

do	
		/usr/lpp/adsm/bin/dsmmigrate -R -D /cimage/storage/arms/${count}*

#### 	
#### Check the time, if after 1600, then schedule script to execute
#### the next day at 0500 
#### 

		if [[ `date +%H` -gt 16 ]]
			
			then 
				echo /usr/local/scripts/cimage_migrate.ksh | at 5:00 am tomorrow
				print $((count = count + 1)) > /usr/local/scripts/counter
				kill $$
				exit 0
		fi

		print $((count = count + 1)) > /usr/local/scripts/counter

	else
	
		if [[ `date +%H` -gt 16 ]]
         
		               then 
                                echo /usr/local/scripts/cimage_migrate.ksh | at 5:00 am tomorrow
                               	print $((count = count + 1)) > /usr/local/scripts/counter 
				kill $$
                                exit 0
		fi

		count=10
		/usr/lpp/adsm/bin/dsmmigrate -R -D /cimage/storage/arms/${count}*
		print $((count = count + 1)) > /usr/local/scripts/counter
done

exit 0

This file last modified 02/04/09

-
Cimage Migration Script
-
 


FREE Domain Registration
included with Web Site Hosting
Tools, Social Networking, Blog

www.siteox.com

Business Web Site Hosting
$3.99 / month includes Tools,
Shopping Cart, Site Builder

www.siteox.com