1 #!/bin/sh
2
3 # AdvancedCopy Manager
4 # All Rights Reserved, Copyright FUJITSU LIMITED, 2005-2006
5
6 #
7 # Postprocessing of tape copy processing
8 #
9 # Argument: $1 Device name of backup disk
10 # $2 Reserve
11 #
12 # Error number
13 # 2: Argument error
14
15 # Argument check
16 case $# in
17 1)
18 ;;
19 2)
20 ;;
21 *)
22 exit 2
23 ;;
24 esac
25
26 device="`echo $1`"
27
28 # Determination of postprocessing file name
29
30 if [ "$SWSTGNODE" != "" ]
31 then
32 swstg_node="/`echo $SWSTGNODE`"
33 else
34 swstg_node=""
35 fi
36
37 err_log_path="/var/opt/FJSVswsts"$swstg_node"/log"
38
39 if [ "`echo $device | /usr/bin/grep "/dev/dsk/"`" != "" ]
40 then
41 # /dev/dsk/c?t?d?s? -> c?t?d?s?
42 dev="`echo $device | /usr/bin/sed "s/\/dev\/dsk\///"`"
43 elif [ "`echo $device | /usr/bin/grep "/dev/FJSV"`" != "" ]
44 then
45 # /dev/FJSVmphd/dsk/mplb?s? -> /dev/FJSVmphd/dsk/mplb?s?
46 # /dev/FJSVmphd/dsk/mphd?s? -> /dev/FJSVmphd/dsk/mphd?s?
47 dev="`echo $device | /usr/bin/cut -d/ -f5`"
48 elif [ "`echo $device | /usr/bin/grep "/dev/sfdsk/"`" != "" ]
49 then
50 # /dev/sfdsk/class/dsk/volume -> _gds_class_volume
51 dev="_gds_`echo $device | /usr/bin/sed "s/\/dev\/sfdsk\///"`"
52 dev="`echo $dev | /usr/bin/sed "s/\/dsk\//_/"`"
53 elif [ "`echo $device | /usr/bin/grep "/dev/vx/dsk/"`" != "" ]
54 then
55 # /dev/vx/dsk/volume -> _vx_rootdg_volume
56 # /dev/vx/dsk/disk-group/volume -> _vx_disk-group_volume
57 dev=_vx_"`echo $device | /usr/bin/awk -F\/ '{ if (NF == 6) { print $5"_"$6 } else print "rootdg_"$5 }'`"
58 elif [ "`echo $device | /usr/bin/grep "/dev/vx/dmp/"`" != "" ]
59 then
60 # /dev/vx/dmp/device -> _vx_pv_device
61 dev=_vx_pv_"`echo $device | /usr/bin/cut -d/ -f5`"
62 else
63 exit 0
64 fi
65 post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre"
66
67 # Confirmation of postprocessing
68 if [ ! -r $post_file ]
69 then
70 exit 0
71 fi
72
73 /usr/bin/rm -f $post_file 2> /dev/null
74 exit 0 |