ページの先頭行へ戻る
ETERNUS SF AdvancedCopy Manager 15.1 運用ガイド テープサーバオプション編
ETERNUS

A.4.4 Linuxのテープコピー実行時の後処理

テープコピー実行時の後処理のシェルスクリプト名は、以下のとおりです。

シェルスクリプトの内容は、以下のとおりです。

  1: #!/bin/sh
  2: 
  3: # AdvancedCopy Manager
  4: # Copyright FUJITSU LIMITED, 2005-2012
  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 | /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/vd"`" != "" ]
 44: then
 45:    # /dev/vd? -> vd?
 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:    # /dev/sfdsk/class/dsk/volume -> _gds_class_volume
 55:    dev="_gds_`echo $device | /bin/sed "s/\/dev\/sfdsk\///"`"
 56:    dev="`echo $dev | /bin/sed "s/\/dsk\//_/"`"
 57: elif [ "`echo $device | /bin/grep "/dev/vx/dmp/"`" != "" ]
 58: then
 59:    # "/dev/vx/dmp/<device>" -> "_vx_pv_<device>"
 60:    dev="_vx_pv_`echo $device | /bin/sed "s/\/dev\/vx\/dmp\///"`"
 61: elif [ "`echo $device | /bin/grep "/dev/mapper/"`" != "" ]
 62: then
 63:    # "/dev/mapper/<device>" -> "_mapper_<device>"
 64:    dev="_mapper_`echo $device | /bin/sed "s/\/dev\/mapper\///"`"
 65: elif [ "`echo $device | /bin/grep "/dev/disk/by-id/"`" != "" ]
 66: then
 67:    # "/dev/disk/by-id/<device>" -> "_by-id_<device>"
 68:    dev="_by-id_`echo $device | /bin/sed "s/\/dev\/disk\/by-id\///"`"
 69: elif [ "`echo $device | /bin/grep "/dev/disk/by-path/"`" != "" ]
 70: then
 71:    # "/dev/disk/by-path/<device>" -> "_by-path_<device>"
 72:    dev="_by-path_`echo $device | /bin/sed "s/\/dev\/disk\/by-path\///"`"
 73: else
 74:    exit 0
 75: fi
 76: post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre"
 77: 
 78: # Confirmation of postprocessing
 79: if [ ! -r $post_file ]
 80: then
 81:    exit 0
 82: fi
 83: /bin/rm -f $post_file 2> /dev/null
 84: 
 85: exit 0