ETERNUS SF AdvancedCopy Manager Operator's Guide 13.0 -Linux- |
Contents
Index
![]() ![]() |
This appendix describes shell scripts used for preprocessing and postprocessing of backup and restoration.
Note that a shell script described in this appendix has different linefeed positions due to formatting of this manual.
Shell scripts used for preprocessing and postprocessing of backup or restoration are started before and after backup or restoration when a backup or restore execution command is executed.
These shell scripts describe processing required by AdvancedCopy Manager to back up or restore a transaction volume.
This chapter describes the setup of preprocessing and postprocessing.
Backup on AdvancedCopy Manager must be performed basically while access to a transaction volume from other processes is inhibited.
Normally, the preprocessing acquires the mount status of a transaction volume using the transaction volume name and then performs the following processing:
Transaction volume status |
Preprocessing |
---|---|
Mounted |
Unmount a transaction volume.(*1) |
Unmounted |
Take no action. |
*1 If the transaction volume cannot be unmounted, however, customize the shell script for pre-processing. For information on this customization, see the section on "When you do not want to unmount a transaction volume."
What to do in the postprocessing must be determined depending on what has been done in the preprocessing.
Preprocessing |
Postprocessing |
---|---|
A transaction volume was unmounted. |
Remount the transaction volume. |
Take no action. |
Take no action. |
If no transaction volume has been mounted since the start of system operation (e.g., a transaction volume used as a database), neither pre- nor post-processing is performed.
If special preprocessing or postprocessing is required, you need to add the concerned processing to a shell script.
When customizing a script, strictly observe the following rules regarding error code:
Error code |
Usage |
---|---|
0-99 |
Unusable (reserved for AdvancedCopy Manager) |
100-255 |
Usable |
If post-processing was failed, execute the Resource match command because the consistency of resource information may be incomplete.
The name of the shell script for pre-processing before backup processing is as follows.
In the case of non-cluster operation
/etc/opt/FJSVswsts/sh/OpcBackup.pre
In the case of cluster operation
/etc/opt/FJSVswsts/<logic node name>/sh/OpcBackup.pre
1: #!/bin/sh 2: 3: # AdvancedCopy Manager 4: # All Rights Reserved, Copyright FUJITSU LIMITED, 2002-2006 5: 6: # 7: # Preprocessing of backup processing 8: # 9: # Argument: $1 Device name of transaction disk 10: # $2 Mount point of transaction disk 11: # $3 Device name of backup disk 12: # 13: # Error number 14: # 2: Argument error 15: # 10: umount error 16: # 13: Illegal mount type (bind/stack mount) 17: 18: 19: # Argument check 20: case $# in 21: 1) 22: ;; 23: 2) 24: ;; 25: 3) 26: ;; 27: *) 28: exit 2 29: ;; 30: esac 31: 32: device="`echo $1`" 33: mount_point="`echo $2`" 34: bk_device="`echo $3`" 35: 36: # Determination postprocessing file name 37: 38: if [ "$SWSTGNODE" != "" ] 39: then 40: swstg_node="/`echo $SWSTGNODE`" 41: else 42: swstg_node="" 43: fi 44: 45: err_log_path="/var/opt/FJSVswsts"$swstg_node"/log" 46: 47: if [ "`echo $device | /bin/grep "/dev/sd"`" != "" ] 48: then 49: # /dev/sd? -> sd? 50: dev="`echo $device | /bin/sed "s/\/dev\///"`" 51: elif [ "`echo $device | /bin/grep "/dev/FJSV"`" != "" ] 52: then 53: # /dev/FJSVmphd/dsk/mplb?s? -> mplb?s? 54: # /dev/FJSVmphd/dsk/mphd?s? -> mphd?s? 55: dev="`echo $device | /bin/cut -d/ -f5`" 56: elif [ "`echo $device | /bin/grep "/dev/sfdsk/"`" != "" ] 57: then 58: if [ "`echo $device | /bin/grep ":"`" != "" ] 59: then 60: # /dev/sfdsk/class/dsk/volume:sd? -> class_volume_sd? 61: dev="`echo $device | /bin/sed "s/\/dev\/sfdsk\///"`" 62: dev="`echo $dev | /bin/sed "s/\/dsk\//_/"`" 63: dev="`echo $dev | /bin/sed "s/:/_/"`" 64: device="`echo $device | /bin/cut -d: -f1`" 65: else 66: # /dev/sfdsk/class/dsk/volume -> _gds_class_volume 67: dev="_gds_`echo $device | /bin/sed "s/\/dev\/sfdsk\///"`" 68: dev="`echo $dev | /bin/sed "s/\/dsk\//_/"`" 69: fi 70: else 71: exit 0 72: fi 73: post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre" 74: fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype" 75: bd_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".bd" 76: 77: if [ "$mount_point" != "" ] 78: then 79: 80: # When device cannot be unmounted 81: # 82: # if [ "$device" = "/dev/sd*" ] 83: # then 84: # if [ "$bk_device" != "" ] 85: # then 86: # echo $bk_device > $bd_file 87: # fi 88: # /bin/awk "\$2==\"$mount_point\" {print \$3}" /proc/mounts > $fstype_file 89: # /bin/sync 90: # /bin/sync 91: # /bin/sync 92: # echo "fsck" > $post_file 93: 94: # When device can be unmounted 95: # 96: # else 97: if [ `/bin/cat /proc/mounts |/bin/cut -d' ' -f 2|/bin/grep "^$mount_point\$"|/usr/bin/wc -w` != 1 ]; then 98: # stack mount (multi device on $mount_point) 99: /bin/mount > $err_log_path/$dev.umount 2>&1 100: exit 13 101: fi 102: if [ `/bin/cat /proc/mounts |/bin/cut -d' ' -f 1|/bin/grep "^$device\$"|/usr/bin/wc -w` != 1 ]; then 103: # bind mount (device has multi mount point) 104: /bin/mount > $err_log_path/$dev.umount 2>&1 105: exit 13 106: fi 107: 108: /bin/awk "\$2==\"$mount_point\" {print \$3}" /proc/mounts > $fstype_file 109: /bin/umount $mount_point 2>/dev/null 110: if [ $? != 0 ] 111: then 112: retry_count=3 113: sleep_time=1 114: result_flag=1 115: 116: while [ $retry_count -gt 0 ] 117: do 118: /bin/umount $mount_point > $err_log_path/$dev.umount 2>&1 119: if [ $? != 0 ] 120: then 121: retry_count=`expr $retry_count - 1` 122: /bin/sleep $sleep_time 123: else 124: /bin/rm -f $err_log_path/$dev.umount 125: result_flag=0 126: break 127: fi 128: done 129: 130: if [ $result_flag != 0 ] 131: then 132: /sbin/fuser -vu $mount_point> $err_log_path/$dev.fuser 2>&1 133: /bin/ps -ef > $err_log_path/$dev.ps 2>&1 134: 135: exit 10 136: fi 137: fi 138: echo "mount" > $post_file 139: 140: # fi 141: 142: # When device was not mounted 143: # 144: else 145: echo "none" > $post_file 146: fi 147: 148: exit 0 |
Use an editor to delete the comments ("#") on the 82nd to 92th, 96th, and 140th lines for a transaction volume that is mounted but you do not want to unmount, and indicate the target device in the if statement on the 82nd line.
Do not update the file system of the transaction volume in the period from execution of the sync command on the 91st line to backup postprocessing. Otherwise, the backed-up file system may be incomplete or execution of the fsck command in the backup postprocessing may result in an error.
This operation is possible only when the file system is one of the following two:
ext2
ext3
The preprocessing by the customized scripts is as follows:
State of transaction volume |
preprocessing |
It is mounted. |
Updating to operating volume is deterred. |
The postprocessing by the customized scripts is as follows:
preprocessing |
postprocessing |
Updating to operating volume was deterred. |
The updating deterrence to operating volume is canceled. Matching of the backup volume is checked. |
The name of the shell script for post-processing before backup processing is as follows.
In the case of non-cluster operation
/etc/opt/FJSVswsts/sh/OpcBackup.post
In the case of cluster operation
/etc/opt/FJSVswsts/<logic node name>/sh/OpcBackup.post
1: #!/bin/sh 2: 3: # AdvancedCopy Manager 4: # All Rights Reserved, Copyright FUJITSU LIMITED, 2002-2006 5: 6: # 7: # Postprocessing 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: # /dev/sfdsk/class/dsk/volume:sd? -> class_volume_sd? 56: dev="`echo $device | /bin/sed "s/\/dev\/sfdsk\///"`" 57: dev="`echo $dev | /bin/sed "s/\/dsk\//_/"`" 58: dev="`echo $dev | /bin/sed "s/:/_/"`" 59: device="`echo $device | /bin/cut -d: -f1`" 60: else 61: # /dev/sfdsk/class/dsk/volume -> _gds_class_volume 62: dev="_gds_`echo $device | /bin/sed "s/\/dev\/sfdsk\///"`" 63: dev="`echo $dev | /bin/sed "s/\/dsk\//_/"`" 64: fi 65: else 66: exit 0 67: fi 68: post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre" 69: fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype" 70: bd_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".bd" 71: 72: # Confirmation of postprocessing 73: if [ ! -r $post_file ] 74: then 75: exit 0 76: fi 77: post="`/bin/cat $post_file`" 78: 79: # Confirmation of FStype 80: if [ ! -r $fstype_file ] 81: then 82: fs="" 83: else 84: fs="`/bin/cat $fstype_file`" 85: fi 86: 87: # No processing 88: if [ "$post" = "none" ] 89: then 90: /bin/rm -rf $post_file 2> /dev/null 91: /bin/rm -rf $fstype_file 2> /dev/null 92: exit 0 93: fi 94: 95: # mount processing 96: if [ "$post" = "mount" ] 97: then 98: Result="`/bin/df -l | /bin/grep "$device " | /bin/awk 'END {print NR}'`" 99: if [ "$Result" != "1" ] 100: then 101: if [ ! -r $fstype_file ] 102: then 103: /bin/mount $device $mount_point 2> /dev/null 104: else 105: Result1="`echo $fs | /bin/awk 'END {print NR}'`" 106: if [ "$Result1" != "1" ] 107: then 108: /bin/mount $device $mount_point 2> /dev/null 109: else 110: /bin/mount -t $fs $device $mount_point 2> /dev/null 111: fi 112: fi 113: if [ $? != 0 ] 114: then 115: retry_count=3 116: sleep_time=1 117: result_flag=1 118: 119: while [ $retry_count -gt 0 ] 120: do 121: if [ ! -r $fstype_file ] 122: then 123: /bin/mount $device $mount_point > $err_log_path/$dev.mount 2>&1 124: else 125: Result1="`echo $fs | /bin/awk 'END {print NR}'`" 126: if [ "$Result1" != "1" ] 127: then 128: /bin/mount $device $mount_point > $err_log_path/$dev.mount 2>&1 129: else 130: /bin/mount -t $fs $device $mount_point > $err_log_path/$dev.mount 2>&1 131: fi 132: fi 133: if [ $? != 0 ] 134: then 135: retry_count=`expr $retry_count - 1` 136: /bin/sleep $sleep_time 137: else 138: /bin/rm -f $err_log_path/$dev.mount 139: result_flag=0 140: break 141: fi 142: done 143: 144: if [ $result_flag != 0 ] 145: then 146: exit 11 147: fi 148: fi 149: fi 150: /bin/rm -rf $post_file 2> /dev/null 151: /bin/rm -rf $fstype_file 2> /dev/null 152: exit 0 153: fi 154: 155: # fsck processing 156: if [ "$post" = "fsck" ] 157: then 158: if [ -r $bd_file ] 159: then 160: bk_device="`/bin/cat $bd_file`" 161: fsck_dev="`echo $bk_device `" 162: if [ ! -r $fstype_file ] 163: then 164: /sbin/fsck -c $fsck_dev > /dev/null 2>&1 165: else 166: if [ "$fs" = "" ] 167: then 168: /sbin/fsck -c $fsck_dev > /dev/null 2>&1 169: else 170: if [ "$fs" = "sfxfs" ] 171: then 172: /sbin/sfxadm $fsck_dev > /dev/null 2>&1 173: /sbin/fsck -p -t $fs $fsck_dev > /dev/null 2>&1 174: else 175: /sbin/fsck -p -t $fs $fsck_dev > /dev/null 2>&1 176: fi 177: fi 178: fi 179: if [ $? != 0 ] 180: then 181: if [ "$fs" = "" ] 182: then 183: result="`/sbin/fsck -p $fsck_dev `" 184: else 185: result="`/sbin/fsck -p -t $fs $fsck_dev `" 186: fi 187: fsck_rc=$? 188: if [ $fsck_rc != 0 ] && [ $fsck_rc != 1 ] 189: then 190: echo "$result" > $err_log_path/$dev.fsck 191: exit 12 192: fi 193: fi 194: fi 195: /bin/rm -rf $post_file 2> /dev/null 196: /bin/rm -rf $fstype_file 2> /dev/null 197: /bin/rm -rf $bd_file 2> /dev/null 198: exit 0 199: fi 200: 201: exit 0 |
In AdvancedCopy Manager, restore processing must be performed while transaction volumes are unmounted.
Thus, in pre-processing, the mount state of the transaction volume is determined using its name, and the following processing is then performed:
Transaction volume status |
Preprocessing |
---|---|
Mounted |
Unmount the transaction volume. |
Unmounted |
Take no action. |
What to do in the postprocessing must be determined depending on what has been done in the preprocessing.
Preprocessing |
Postprocessing |
---|---|
A transaction volume was unmounted. |
Remount the transaction volume. |
Take no action. |
Take no action. |
If special preprocessing or postprocessing is required, you need to add the concerned processing to a shell script.
When customizing a script, strictly observe the following rules regarding error code:
Error code |
Usage |
---|---|
0-99 |
Unusable (reserved for AdvancedCopy Manager) |
100-255 |
Usable |
If pos-tprocessing was failed, execute the Resource match command because the consistency of resource information may be incomplete.
The name of the shell script for pre-processing before restore processing is as follows.
In the case of non-cluster operation
/etc/opt/FJSVswsts/sh/OpcRestore.pre
In the case of cluster operation
/etc/opt/FJSVswsts/<logic node name>/sh/OpcRestore.pre
1: #!/bin/sh 2: 3: # AdvancedCopy Manager 4: # All Rights Reserved, Copyright FUJITSU LIMITED, 2002-2006 5: 6: # 7: # Preprocessing 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: # 10: umount error 15: # 13: Illegal mount type (bind/stack mount) 16: 17: 18: # Argument check 19: case $# in 20: 1) 21: ;; 22: 2) 23: ;; 24: *) 25: exit 2 26: ;; 27: esac 28: 29: device="`echo $1`" 30: mount_point="`echo $2`" 31: 32: # Determination of postprocessing file name 33: 34: if [ "$SWSTGNODE" != "" ] 35: then 36: swstg_node="/`echo $SWSTGNODE`" 37: else 38: swstg_node="" 39: fi 40: 41: err_log_path="/var/opt/FJSVswsts"$swstg_node"/log" 42: 43: if [ "`echo $device | /bin/grep "/dev/sd"`" != "" ] 44: then 45: # /dev/sd? -> sd? 46: dev="`echo $device | /bin/sed "s/\/dev\///"`" 47: elif [ "`echo $device | /bin/grep "/dev/FJSV"`" != "" ] 48: then 49: # /dev/FJSVmphd/dsk/mplb?s? -> mplb?s? 50: # /dev/FJSVmphd/dsk/mphd?s? -> mphd?s? 51: dev="`echo $device | /bin/cut -d/ -f5`" 52: elif [ "`echo $device | /bin/grep "/dev/sfdsk/"`" != "" ] 53: then 54: if [ "`echo $device | /bin/grep ":"`" != "" ] 55: then 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: else 62: # /dev/sfdsk/class/dsk/volume -> _gds_class_volume 63: dev="_gds_`echo $device | /bin/sed "s/\/dev\/sfdsk\///"`" 64: dev="`echo $dev | /bin/sed "s/\/dsk\//_/"`" 65: fi 66: else 67: exit 0 68: fi 69: post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre" 70: fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype" 71: 72: if [ "$mount_point" != "" ] 73: then 74: if [ `/bin/cat /proc/mounts |/bin/cut -d' ' -f 2|/bin/grep "^$mount_point\$"|/usr/bin/wc -w` != 1 ]; then 75: # stack mount (multi device on $mount_point) 76: /bin/mount > $err_log_path/$dev.umount 2>&1 77: exit 13 78: fi 79: if [ `/bin/cat /proc/mounts |/bin/cut -d' ' -f 1|/bin/grep "^$device\$"|/usr/bin/wc -w` != 1 ]; then 80: # bind mount (device has multi mount point) 81: /bin/mount > $err_log_path/$dev.umount 2>&1 82: exit 13 83: fi 84: 85: 86: # When device can be unmounted 87: # 88: # df -ln $mount_point | cut -f2 -d: | cut -f2 -d' ' > $fstype_file 89: /bin/awk "\$2==\"$mount_point\" {print \$3}" /proc/mounts > $fstype_file 90: /bin/umount $mount_point 2> /dev/null 91: if [ $? != 0 ] 92: then 93: retry_count=3 94: sleep_time=1 95: result_flag=1 96: 97: while [ $retry_count -gt 0 ] 98: do 99: /bin/umount $mount_point > $err_log_path/$dev.umount 2>&1 100: if [ $? != 0 ] 101: then 102: retry_count=`expr $retry_count - 1` 103: /bin/sleep $sleep_time 104: else 105: /bin/rm -f $err_log_path/$dev.umount 106: result_flag=0 107: break 108: fi 109: done 110: 111: if [ $result_flag != 0 ] 112: then 113: /sbin/fuser -vu $mount_point> $err_log_path/$dev.fuser 2>&1 114: /bin/ps -ef > $err_log_path/$dev.ps 2>&1 115: 116: exit 10 117: fi 118: fi 119: echo "mount" > $post_file 120: 121: # When device was not mounted 122: # 123: else 124: echo "none" > $post_file 125: fi 126: 127: exit 0 |
Restore processing is not possible on a mounted transaction volume that cannot be unmounted. Specify a device at the restore destination.
The name of the shell script for post-processing after restore processing is as follows.
In the case of non-cluster operation
/etc/opt/FJSVswsts/sh/OpcRestore.post
In the case of non-cluster operation
/etc/opt/FJSVswsts/<logic node name>/sh/OpcRestore.post
1: #!/bin/sh 2: 3: # AdvancedCopy Manager 4: # All Rights Reserved, Copyright FUJITSU LIMITED, 2002-2006 5: 6: # 7: # Preprocessing 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: # 10: umount error 15: # 13: Illegal mount type (bind/stack mount) 16: 17: 18: # Argument check 19: case $# in 20: 1) 21: ;; 22: 2) 23: ;; 24: *) 25: exit 2 26: ;; 27: esac 28: 29: device="`echo $1`" 30: mount_point="`echo $2`" 31: 32: # Determination of postprocessing file name 33: 34: if [ "$SWSTGNODE" != "" ] 35: then 36: swstg_node="/`echo $SWSTGNODE`" 37: else 38: swstg_node="" 39: fi 40: 41: err_log_path="/var/opt/FJSVswsts"$swstg_node"/log" 42: 43: if [ "`echo $device | /bin/grep "/dev/sd"`" != "" ] 44: then 45: # /dev/sd? -> sd? 46: dev="`echo $device | /bin/sed "s/\/dev\///"`" 47: elif [ "`echo $device | /bin/grep "/dev/FJSV"`" != "" ] 48: then 49: # /dev/FJSVmphd/dsk/mplb?s? -> mplb?s? 50: # /dev/FJSVmphd/dsk/mphd?s? -> mphd?s? 51: dev="`echo $device | /bin/cut -d/ -f5`" 52: elif [ "`echo $device | /bin/grep "/dev/sfdsk/"`" != "" ] 53: then 54: if [ "`echo $device | /bin/grep ":"`" != "" ] 55: then 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: else 62: # /dev/sfdsk/class/dsk/volume -> _gds_class_volume 63: dev="_gds_`echo $device | /bin/sed "s/\/dev\/sfdsk\///"`" 64: dev="`echo $dev | /bin/sed "s/\/dsk\//_/"`" 65: fi 66: else 67: exit 0 68: fi 69: post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre" 70: fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype" 71: 72: if [ "$mount_point" != "" ] 73: then 74: if [ `/bin/cat /proc/mounts |/bin/cut -d' ' -f 2|/bin/grep "^$mount_point\$"|/usr/bin/wc -w` != 1 ]; then 75: # stack mount (multi device on $mount_point) 76: /bin/mount > $err_log_path/$dev.umount 2>&1 77: exit 13 78: fi 79: if [ `/bin/cat /proc/mounts |/bin/cut -d' ' -f 1|/bin/grep "^$device\$"|/usr/bin/wc -w` != 1 ]; then 80: # bind mount (device has multi mount point) 81: /bin/mount > $err_log_path/$dev.umount 2>&1 82: exit 13 83: fi 84: 85: 86: # When device can be unmounted 87: # 88: # df -ln $mount_point | cut -f2 -d: | cut -f2 -d' ' > $fstype_file 89: /bin/awk "\$2==\"$mount_point\" {print \$3}" /proc/mounts > $fstype_file 90: /bin/umount $mount_point 2> /dev/null 91: if [ $? != 0 ] 92: then 93: retry_count=3 94: sleep_time=1 95: result_flag=1 96: 97: while [ $retry_count -gt 0 ] 98: do 99: /bin/umount $mount_point > $err_log_path/$dev.umount 2>&1 100: if [ $? != 0 ] 101: then 102: retry_count=`expr $retry_count - 1` 103: /bin/sleep $sleep_time 104: else 105: /bin/rm -f $err_log_path/$dev.umount 106: result_flag=0 107: break 108: fi 109: done 110: 111: if [ $result_flag != 0 ] 112: then 113: /sbin/fuser -vu $mount_point> $err_log_path/$dev.fuser 2>&1 114: /bin/ps -ef > $err_log_path/$dev.ps 2>&1 115: 116: exit 10 117: fi 118: fi 119: echo "mount" > $post_file 120: 121: # When device was not mounted 122: # 123: else 124: echo "none" > $post_file 125: fi 126: 127: exit 0 |
Contents
Index
![]() ![]() |