The name of a script file for post-processing of a backup is as follows.
/etc/opt/FJSVswsts/sh/OpcBackup.post
/etc/opt/FJSVswsts/<logic node name>/sh/OpcBackup.post
1: #!/bin/sh 2: 3: # AdvancedCopy Manager 4: # All Rights Reserved, Copyright FUJITSU LIMITED, 2002-2009 5: 6: # 7: # Post-processing of backup 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: # 12: fsck error 16: 17: # Argument check 18: case $# in 19: 1) 20: ;; 21: 2) 22: ;; 23: *) 24: exit 2 25: ;; 26: esac 27: 28: device="`echo $1`" 29: mount_point="`echo $2`" 30: 31: # Determination of postprocessing file name 32: 33: if [ "$SWSTGNODE" != "" ] 34: then 35: swstg_node="/`echo $SWSTGNODE`" 36: else 37: swstg_node="" 38: fi 39: 40: err_log_path="/var/opt/FJSVswsts"$swstg_node"/log" 41: 42: if [ "`echo $device | /bin/grep "/dev/sd"`" != "" ] 43: then 44: # /dev/sd? -> sd? 45: dev="`echo $device | /bin/sed "s/\/dev\///"`" 46: elif [ "`echo $device | /bin/grep "/dev/FJSV"`" != "" ] 47: then 48: # /dev/FJSVmphd/dsk/mplb?s? -> mplb?s? 49: # /dev/FJSVmphd/dsk/mphd?s? -> mphd?s? 50: dev="`echo $device | /bin/cut -d/ -f5`" 51: elif [ "`echo $device | /bin/grep "/dev/sfdsk/"`" != "" ] 52: then 53: if [ "`echo $device | /bin/grep ":"`" != "" ] 54: then 55: devnam="`echo $device | /bin/cut -d: -f2-`" 56: # /dev/sfdsk/class/dsk/volume:sd? -> class_volume_sd? 57: dev="`echo $device | /bin/sed "s/\/dev\/sfdsk\///"`" 58: dev="`echo $dev | /bin/sed "s/\/dsk\//_/"`" 59: dev="`echo $dev | /bin/sed "s/:/_/"`" 60: device="`echo $device | /bin/cut -d: -f1`" 61: if [ "`echo $devnam | /bin/grep "/dev/disk/by-id/"`" != "" ] 62: then 63: # /dev/sfdsk/class/dsk/volume:/dev/disk/by-id/<device> -> class_volume_by_id_<device> 64: dev="`echo $dev | /bin/sed "s/\/dev\/disk\/by-id\//_by-id_/"`" 65: elif [ "`echo $devnam | /bin/grep "/dev/disk/by-path/"`" != "" ] 66: then 67: # /dev/sfdsk/class/dsk/volume:/dev/disk/by-path/<device> -> class_volume_by_path_<device> 68: dev="`echo $dev | /bin/sed "s/\/dev\/disk\/by-path\//_by-path_/"`" 69: fi 70: else 71: # /dev/sfdsk/class/dsk/volume -> _gds_class_volume 72: dev="_gds_`echo $device | /bin/sed "s/\/dev\/sfdsk\///"`" 73: dev="`echo $dev | /bin/sed "s/\/dsk\//_/"`" 74: fi 75: elif [ "`echo $device | /bin/grep "/dev/disk/by-id/"`" != "" ] 76: then 77: # "/dev/disk/by-id/<device>" -> "_by-id_<device>" 78: dev="_by-id_`echo $device | /bin/sed "s/\/dev\/disk\/by-id\///"`" 79: elif [ "`echo $device | /bin/grep "/dev/disk/by-path/"`" != "" ] 80: then 81: # "/dev/disk/by-path/<device>" -> "_by-path_<device>" 82: dev="_by-path_`echo $device | /bin/sed "s/\/dev\/disk\/by-path\///"`" 83: else 84: exit 0 85: fi 86: post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre" 87: fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype" 88: bd_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".bd" 89: 90: # Confirmation of postprocessing 91: if [ ! -r $post_file ] 92: then 93: exit 0 94: fi 95: post="`/bin/cat $post_file`" 96: 97: # Confirmation of FStype 98: if [ ! -r $fstype_file ] 99: then 100: fs="" 101: else 102: fs="`/bin/cat $fstype_file`" 103: fi 104: 105: # No processing 106: if [ "$post" = "none" ] 107: then 108: /bin/rm -rf $post_file 2> /dev/null 109: /bin/rm -rf $fstype_file 2> /dev/null 110: exit 0 111: fi 112: 113: # mount processing 114: if [ "$post" = "mount" ] 115: then 116: if [ "`echo $device | /bin/grep "/dev/disk/by-id/"`" != "" \ 117: -o "`echo $device | /bin/grep "/dev/disk/by-path/"`" != "" ] 118: then 119: cdevice="/dev/`/usr/bin/readlink $device | /bin/sed "s/..\/..\///"`" 120: Result="`/bin/df -l | /bin/grep "$cdevice " | /bin/awk 'END {print NR}'`" 121: else 122: Result="`/bin/df -l | /bin/grep "$device " | /bin/awk 'END {print NR}'`" 123: fi 124: if [ "$Result" != "1" ] 125: then 126: if [ ! -r $fstype_file ] 127: then 128: /bin/mount $device $mount_point 2> /dev/null 129: else 130: Result1="`echo $fs | /bin/awk 'END {print NR}'`" 131: if [ "$Result1" != "1" ] 132: then 133: /bin/mount $device $mount_point 2> /dev/null 134: else 135: /bin/mount -t $fs $device $mount_point 2> /dev/null 136: fi 137: fi 138: if [ $? != 0 ] 139: then 140: retry_count=3 141: sleep_time=1 142: result_flag=1 143: 144: while [ $retry_count -gt 0 ] 145: do 146: if [ ! -r $fstype_file ] 147: then 148: /bin/mount $device $mount_point > $err_log_path/$dev.mount 2>&1 149: else 150: Result1="`echo $fs | /bin/awk 'END {print NR}'`" 151: if [ "$Result1" != "1" ] 152: then 153: /bin/mount $device $mount_point > $err_log_path/$dev.mount 2>&1 154: else 155: /bin/mount -t $fs $device $mount_point > $err_log_path/$dev.mount 2>&1 156: fi 157: fi 158: if [ $? != 0 ] 159: then 160: retry_count=`expr $retry_count - 1` 161: /bin/sleep $sleep_time 162: else 163: /bin/rm -f $err_log_path/$dev.mount 164: result_flag=0 165: break 166: fi 167: done 168: 169: if [ $result_flag != 0 ] 170: then 171: exit 11 172: fi 173: fi 174: fi 175: /bin/rm -rf $post_file 2> /dev/null 176: /bin/rm -rf $fstype_file 2> /dev/null 177: exit 0 178: fi 179: 180: # fsck processing 181: if [ "$post" = "fsck" ] 182: then 183: if [ -r $bd_file ] 184: then 185: bk_device="`/bin/cat $bd_file`" 186: fsck_dev="`echo $bk_device `" 187: if [ ! -r $fstype_file ] 188: then 189: /sbin/fsck -c $fsck_dev > /dev/null 2>&1 190: else 191: if [ "$fs" = "" ] 192: then 193: /sbin/fsck -c $fsck_dev > /dev/null 2>&1 194: else 195: if [ "$fs" = "sfxfs" ] 196: then 197: /sbin/sfxadm $fsck_dev > /dev/null 2>&1 198: /sbin/fsck -p -t $fs $fsck_dev > /dev/null 2>&1 199: else 200: /sbin/fsck -p -t $fs $fsck_dev > /dev/null 2>&1 201: fi 202: fi 203: fi 204: if [ $? != 0 ] 205: then 206: if[ "$fs"= "" ] 207: then 208: result="`/sbin/fsck -p $fsck_dev `" 209: else 210: result="`/sbin/fsck -p -t $fs $fsck_dev `" 211: fi 212: fsck_rc=$? 213: if[ $fsck_rc != 0 ] &&[ $fsck_rc != 1 ] 214: then 215: echo "$result"> $err_log_path/$dev.fsck 216: exit 12 217: fi 218: fi 219: fi 220: /bin/rm -rf $post_file 2> /dev/null 221: /bin/rm -rf $fstype_file 2> /dev/null 222: /bin/rm -rf $bd_file 2> /dev/null 223: exit 0 224: fi 225: 226: exit 0