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

Script to replace a directory and create a new file system

Status
Not open for further replies.

aixadm

MIS
May 11, 2005
28
US
Hello,
I am trying to write a script which supposedly do the following tasks on our AIX server (cluster).
1.Check the rootvg size if rootvg < 1gb then exit otherwise
create a logical volume lvxxxxx_vcl with 1 logical partiton.

2.Stop the cluster using /var/sam1/hastop -local -force

3.Rename the existing directory /var/sam1 to /var/sam1.old
4.creating a new directory
/var/sam1
5.Create and mount the filesystem /var/sam1 using the above defined LV
6.Keep the file system size as 256mb
7.copy contents of /var/sam1.old to newly created /var/sam1
8.remove /var/sam1.old
9.restart cluster using /etc/rc.d/rc2.d/hastart

Could some one help me to make this happen.either KSH or perl is fine.
 
In first point I meant that if free space in rootvg is < 1gb then exit .Just wanted to make it clear
 
What have you tried so far? Where are you stuck?

It seems a strange thing to me to implement in a script; how often do you have to do this??

Annihilannic.
 
Thanks Annihilannic for the response. I have written a script and it seems working good.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top