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

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

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

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

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