Top
ETERNUS SF AdvancedCopy Manager V15.0 Operation Guide

C.2.4 Customizing the shell script

The method to customize the shell script for replication pre/post-processing is explained below.


When the Replication target is a volume group

When replicating a file system which is part of a logical volume in a volume group, the processing scripts will need to be modified as follows:

After making the necessary corrections to the script, convert the exit statements on line 60 of the source volume pre-processing script and line 64 of the destination volume pre-processing script (RepDst.pre) into comments ("#").

If the volume group to be replicated includes a logical volume for which no file system has been built, make the above corrections and then convert the statements on lines 212 to 217 of the destination volume post-processing script (RepDst.post) into comments ("#").

Note

  • Note that unmount/mount processing to a volume group is not carried out if the scripts have not been customized.

  • Modify the parameters and options of the OS commands (such as the mount command and the fsck command), appropriately for their use.

  • If the operation involves activation of the destination volume group, the destination volume post-processing script rewrites (recreatevg) the LVM management information. This processing may take a long time.


Cluster operation using VERITAS Cluster Server

Customization of the pre-processing and post-processing scripts is required when performing cluster operations using VERITAS Cluster Server, and when the mount point of the original/source volume is registered in the cluster transaction.
Change unmount/mount processing in the pre-processing and post-processing scripts into offline/online processing of the mount point resource.
The mount point resource relating to the Volume is immediately offline/online whilst there will be a time delay before access is actually prevented when mount/unmount is used.
Please note that once the offline/online command is issued there will be a delay before the mount/unmount command can be executed. The "sleep" and "df" commands can be used to delay the mount/unmount until after the process that sets the volumes online or offline has completed.

The examples below show how the pre-processing and post-processing scripts are modified.

[Example]
Changing the unmount processing of the source volume pre-processing script (RepSrc.pre)

[lines 70, 79, 100 and 109]

(before change)

/usr/sbin/umount $mount_point

(after change)

/opt/VRTSvcs/bin/hares -offline resource-name -sys system-name
[Example]
Adding unmount wait processing to the source volume pre-processing script (RepSrc.pre)

[lines 98 and 128]

(addition)

mount_status="mounted"
while [ $mount_status = "mounted" ]
do
   mount_status=`/usr/sbin/mount | /usr/bin/nawk -v lv=/dev/XXXXX 'lv==$1{flag=1; exit;} END{if(flag==1) print "mounted"; else print "not_mounted";}'`
done
[Example]
Changing the unmount processing of the destination volume pre-processing script (RepDst.pre)

[lines 74, 83, 104 and 113]

(before change)

/usr/sbin/umount $mount_point

(after change)

/opt/VRTSvcs/bin/hares -offline resource-name -sys system-name
[Example]
Adding unmount wait processing to the destination volume pre-processing script (RepDst.pre)

[lines 102 and 132]

(addition)

mount_status="mounted"
while [ $mount_status = "mounted" ]
do
   mount_status=`/usr/sbin/mount | /usr/bin/nawk -v lv=/dev/XXXXX 'lv==$1{flag=1; exit;} END{if(flag==1) print "mounted"; else print "not_mounted";}'`
done
[Example]
Changing the mount processing of the source volume post-processing script (RepSrc.post)

[lines 77, 86, 110 and 119]

(before change)

/usr/sbin/mount $lvname $lv_mount_point

(after change)

/opt/VRTSvcs/bin/hares -online resource-name -sys system-name
[Example]
Adding mount wait processing to the source volume post-processing script (RepSrc.post)

[lines 104 and 137]

(addition)

mount_status="not_mounted"
while [ $mount_status = "not_mounted" ]
do
   mount_status=`/usr/sbin/mount | /usr/bin/nawk -v lv=$lvname 'lv==$1{flag=1; exit;} END{if(flag==1) print "mounted"; else print "not_mounted";}'`
done
[Example]
Changing the mount processing of the destination volume post-processing script (RepDst.post)

[lines 72 and 81]

(before change)

/usr/sbin/mount $lvname $lv_mount_point

(after change)

/opt/VRTSvcs/bin/hares -online resource-name -sys system-name
[Example]
Adding mount wait processing to the destination volume post-processing script (RepDst.post)

[line 99]

(addition)

mount_status="not_mounted"
while [ $mount_status = "not_mounted" ]
do
   mount_status=`/usr/sbin/mount | /usr/bin/nawk -v lv=$lvname 'lv==$1{flag=1; exit;} END{if(flag==1) print "mounted"; else print "not_mounted";}'`
done