Top
ETERNUS SFAdvancedCopy Manager 14.0 Operator's Guide forTape Server Option

A.4.4 Tape copy post-processing in Linux

The names of the post-processing shell scripts used for tape copying are:

Content of shell script

 1: #!/bin/sh
 2: 
 3: # AdvancedCopy Manager
 4: # All Rights Reserved, Copyright FUJITSU LIMITED, 2005-2007
 5: 
 6: #
 7: #   Post-processing 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 post-processing 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 | /bin/grep "/dev/sd"`" != "" ]
40: then
41: 	# /dev/sd? -> sd?
42: 	dev="`echo $device | /bin/sed "s/\/dev\///"`"
43: elif [ "`echo $device | /bin/grep "/dev/FJSV"`" != "" ]
44: then
45: 	# /dev/FJSVmphd/dsk/mplb?s? -> mplb?s?
46: 	# /dev/FJSVmphd/dsk/mphd?s? -> mphd?s?
47: 	dev="`echo $device | /bin/cut -d/ -f5`"
48: elif [ "`echo $device | /bin/grep "/dev/sfdsk/"`" != "" ]
49: then
50: 	# /dev/sfdsk/class/dsk/volume -> _gds_class_volume
51: 	dev="_gds_`echo $device | /bin/sed "s/\/dev\/sfdsk\///"`"
52: 	dev="`echo $dev | /bin/sed "s/\/dsk\//_/"`"
53: elif [ "`echo $device | /bin/grep "/dev/disk/by-id/"`" != "" ]
54: then
55: 	# "/dev/disk/by-id/<device>" -> "_by-id_<device>"
56: 	dev="_by-id_`echo $device | /bin/sed "s/\/dev\/disk\/by-id\///"`"
57: elif [ "`echo $device | /bin/grep "/dev/disk/by-path/"`" != "" ]
58: then
59: 	# "/dev/disk/by-path/<device>" -> "_by-path_<device>"
60: 	dev="_by-path_`echo $device | /bin/sed "s/\/dev\/disk\/by-path\///"`"
61: else
62: 	exit 0
63: fi
64: post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre"
65: 
66: # Confirmation of post-processing
67: if [ ! -r $post_file ]
68: then
69: 	exit 0
70: fi
71: /bin/rm -f $post_file 2> /dev/null
72: 
73: exit 0