Solstice Backup 5.1 ご使用にあたって

ClearCase VOB のバックアップ

例 1-1 のスクリプトを使って ClearCase VOB (バージョンオブジェクトデータベース) をロックし、バックアップを行なってから、VOB のロックを解除します。カスタマイズしたスクリプトファイルは、Backup の save プログラムがインストールされているディレクトリ (たとえば、Solaris システム上では、save プログラムは /usr/sbin/nsr ディレクトリにインストールされる) に常駐させる必要があります。ClearCase VOB 用に構成された「Client」リソースの「Backup Command」属性にスクリプト名を入力します。スケジュールされたバックアップ処理の過程で、通常の save プログラム の代わりに Backup コマンドが呼び出されます。


例 1-1 ClearCase VOB スクリプト


#!/bin/sh
# export the SHELL that we are going to use
SHELL=/bin/sh
export SHELL
# export the correct PATH so that all the required binaries can be found
case $0 in
/* ) PATH=/usr/atria/bin:/bin:/usr/bin:¥Q/bin/dirname $0¥Q
c=¥Q/bin/basename $0¥Q
;;
* )PATH=/usr/atria/bin:/bin:/usr/bin:/usr/sbin:/usr/bin/nsr:/usr/sbin/nsr
c=$0
;;
esac
export PATH
# These are the valid statuses which save reports on completion of the backup
statuses="
failed.
abandoned.
succeeded.
completed savetime=
"
# Perform the PRECMD (Lock VOB)
/usr/atria/bin/cleartool setview -exec "/usr/atria/bin/cleartoollock -c ¥
`VOB backups in progress' -vob /cm_data/mis_dev" magic_view >
/tmp/voblock.log 2>&1
# Perform backup on client
save "$@" > /tmp/saveout$$ 2>&
# cat out the save output
cat /tmp/saveout$$
# search for the backup status in the output reported by save
for i in ${statuses}; do
result=¥Qgrep "${i}" /tmp/saveout$$¥Q
if [ $? != 0 ]; then
echo ${result}
fi
done
# Perform the POSTCMD (Unlock VOB)
/usr/atria/bin/cleartool setview -exec "/usr/atria/bin/cleartoolunlock - vob
/cm_data/mis_dev" ¥
magic_view > /tmp/vobunlock.log 2>&
# make sure to gracefully exit out of this shell script
exit 0


注意 - 注意 -

バックアップを実行させるためには、スクリプト内に save コマンドを組み込む必要があります。save プログラムと同じディレクトリ内にスクリプトファイルがないと、バックアップは失敗します。