The name of a script file for post-processing of a restoration is as follows.
/etc/opt/FJSVswsts/sh/OpcRestore.post
/etc/opt/FJSVswsts/<logic node name>/sh/OpcRestore.post
1: #!/bin/sh 2: 3: # AdvancedCopy Manager 4: # All Rights Reserved, Copyright FUJITSU LIMITED, 2002-2009 5: 6: # 7: # Post-processing of restoration processing 8: # 9: #Argument: $1 Device name of transaction disk 10: # $2 Mount point of transaction disk 11: # 12: # Error number 13: # 2: Argument error 14: # 11: mount error 15: 16: # Argument check 17: case $# in 18: 1) 19: ;; 20: 2) 21: ;; 22: *) 23: exit 2 24: ;; 25: esac 26: 27: device="`echo $1`" 28: mount_point="`echo $2`" 29: 30: # Determination of postprocessing file name 31: 32: if [ "$SWSTGNODE" != "" ] 33: then 34: swstg_node="/`echo $SWSTGNODE`" 35: else 36: swstg_node="" 37: fi 38: 39: err_log_path="/var/opt/FJSVswsts"$swstg_node"/log" 40: 41: if [ "`echo $device | /usr/bin/grep "/dev/dsk/"`" != "" ] 42: then 43: # /dev/dsk/c?t?d?s? -> c?t?d?s? 44: dev="`echo $device | /usr/bin/sed "s/\/dev\/dsk\///"`" 45: elif [ "`echo $device | /usr/bin/grep "/dev/FJSV"`" != "" ] 46: then 47: # /dev/FJSVmphd/dsk/mplb?s? -> /dev/FJSVmphd/dsk/mplb?s? 48: # /dev/FJSVmphd/dsk/mphd?s? -> /dev/FJSVmphd/dsk/mphd?s? 49: dev="`echo $device | /usr/bin/cut -d/ -f5`" 50: elif [ "`echo $device | /usr/bin/grep "/dev/sfdsk/"`" != "" ] 51: then 52: if [ "`echo $device | /usr/bin/grep ":"`" != "" ] 53: then 54: # /dev/sfdsk/class/dsk/volume:c?t?d? -> class_volume_c?t?d? 55: dev="`echo $device | /usr/bin/sed "s/\/dev\/sfdsk\///"`" 56: dev="`echo $dev | /usr/bin/sed "s/\/dsk\//_/"`" 57: dev="`echo $dev | /usr/bin/sed "s/:/_/"`" 58: device="`echo $device | /usr/bin/cut -d: -f1`" 59: else 60: # /dev/sfdsk/class/dsk/volume -> _gds_class_volume 61: dev="_gds_`echo $device | /usr/bin/sed "s/\/dev\/sfdsk\///"`" 62: dev="`echo $dev | /usr/bin/sed "s/\/dsk\//_/"`" 63: fi 64: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dsk/"`" != "" ] 65: then 66: # /dev/vx/dsk/volume -> _vx_rootdg_volume 67: # /dev/vx/dsk/disk-group/volume -> _vx_disk-group_volume 68: dev=_vx_"`echo $device | /usr/bin/awk -F\/ '{ if (NF == 6) { print $5"_"$6 } else print "rootdg_"$5 }'`" 69: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dmp/"`" != "" ] 70: then 71: # /dev/vx/dmp/device -> _vx_pv_device 72: dev=_vx_pv_"`echo $device | /usr/bin/cut -d/ -f5`" 73: else 74: exit 0 75: fi 76: post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre" 77: fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype" 78: bd_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".bd" 79: 80: # Confirmation of postprocessing 81: if [ ! -r $post_file ] 82: then 83: exit 0 84: fi 85: post="`/usr/bin/cat $post_file`" 86: 87: # Confirmation of FStype 88: if [ ! -r $fstype_file ] 89: then 90: fs="" 91: else 92: fs="`/usr/bin/cat $fstype_file`" 93: fi 94: 95: # No processing 96: if [ "$post" = "none" ] 97: then 98: /usr/bin/rm -rf $post_file 2> /dev/null 99: /usr/bin/rm -rf $fstype_file 2> /dev/null 100: exit 0 101: fi 102: 103: # mount processing 104: if [ "$post" = "mount" ] 105: then 106: /usr/bin/df -l $device > /dev/null 2>&1 107: if [ $? != 0 ] 108: then 109: if [ ! -r $fstype_file ] 110: then 111: /usr/sbin/mount $device $mount_point 2> /dev/null 112: else 113: if [ "$fs" = "" ] 114: then 115: /usr/sbin/mount $device $mount_point 2> /dev/null 116: else 117: if [ "$fs" = "sfxfs" ] 118: then 119: dev="`echo $device | /usr/bin/sed "s/\/dsk\//\/rdsk\//"`" 120: /usr/sbin/sfxadm $dev > /dev/null 2>&1 121: fi 122: /usr/sbin/mount -F $fs $device $mount_point 2> /dev/null 123: fi 124: fi 125: if [ $? != 0 ] 126: then 127: retry_count=3 128: sleep_time=1 129: result_flag=1 130: 131: while [ $retry_count -gt 0 ] 132: do 133: if [ ! -r $fstype_file ] 134: then 135: /usr/sbin/mount $device $mount_point > $err_log_path/$dev.mount 2>&1 136: else 137: if [ "$fs" = "" ] 138: then 139: /usr/sbin/mount $device $mount_point > $err_log_path/$dev.mount 2>&1 140: else 141: if [ "$fs" = "sfxfs" ] 142: then 143: dev="`echo $device | /usr/bin/sed "s/\/dsk\//\/rdsk\//"`" 144: /usr/sbin/sfxadm $dev > $err_log_path/$dev.sfxadm 2>&1 145: fi 146: /usr/sbin/mount -F $fs $device $mount_point > $err_log_path/$dev.mount 2>&1 147: fi 148: fi 149: if [ $? != 0 ] 150: then 151: retry_count=`expr $retry_count - 1` 152: /usr/bin/sleep $sleep_time 153: else 154: /usr/bin/rm -f $err_log_path/$dev.mount 155: result_flag=0 156: break 157: fi 158: done 159: 160: if [ $result_flag != 0 ] 161: then 162: exit 11 163: fi 164: fi 165: fi 166: /usr/bin/rm -rf $post_file 2> /dev/null 167: /usr/bin/rm -rf $fstype_file 2> /dev/null 168: exit 0 169: fi 170: 171: exit 0