Top
ETERNUS SF Storage Cruiser 14.0 User's Guidefor Virtual Storage Conductor

6.2.2 Saving the configuration information


6.2.2.1 [Solaris OS/Linux OS]Saving the configuration information

A commit script is used to save configuration information. VSC Manager automatically executes the commit script whenever configuration information is changed. Create a commit script in "/etc/opt/FJSVssmgr/current/VscCommitScript". Note that "/opt/FJSVssmgr/lib/sample/vsc/VscCommitScript.sample" contains samples of commit scripts.

You can invoke the commit script to save configuration information as required.

The configuration information of VSC Manager is stored in the "/var/opt/FJSVssmgr/current/vsccompose/" directory. Therefore, save all directories and files in this directory. Save the directories and files so that when you restore the configuration information, the directories and files in the "/var/opt/FJSVssmgr/current/vsccompose/" directory are restored in the same directory and file configuration as when saved.

Example

Example of commit script:

#!/bin/sh
#
# All Rights Reserved, Copyright (c) Fujitsu Ltd. 2004
#
# Storage Software Virtual Storage Conductor
#
# CommitScript Sample
#
########################################################

ROOT_DIR=$PWD
BKUP_DIR=/var/opt/FJSVssmgr/current/vsclog/VSCCOMPOSE_BAK
BKUP_TMP_DIR=/var/opt/FJSVssmgr/current/vsclog/VSCCOMPOSE_BAK/tmp
COMPOSE_DIR=/var/opt/FJSVssmgr/current/vsccompose

if [ ! -d $BKUP_DIR ]; then
        mkdir -p $BKUP_DIR
fi
if [ ! -d $BKUP_TMP_DIR ]; then
        mkdir -p $BKUP_TMP_DIR
fi

cp -p $COMPOSE_DIR/* $BKUP_TMP_DIR

if [ $? -eq 0 ]; then
        cd $BKUP_DIR
        tar cf compose.BAK.tar ./tmp
        if [ $? -eq 0 ]; then
                echo "Backup Complete."
                rm -rf $BKUP_TMP_DIR
                cd $ROOT_DIR
                exit 0
        fi
fi
echo "Backup failed."
exit 1

Note

Note that a commit script may cause a delay depending on its coding in VSC Manager processing time because it always starts up whenever there is a change in the resource status of virtual storage.


6.2.2.2 [Windows]Saving the configuration information

A commit script is used to save configuration information. VSC Manager automatically executes the commit script whenever configuration information is changed. Create a commit script in "$ENV_DIR\Manager\etc\opt\FJSVssmgr\current\VscCommitScript.bat".
Note that "$INS_DIR\Manager\opt\FJSVssmgr\lib\sample\vsc\VscCommitScript.bat.sample" contains samples of commit scripts.

You can invoke the commit script to save configuration information as required.

The configuration information of VSC Manager is stored in the "$TMP_DIR\Manager\var\opt\FJSVssmgr\current\vsccompose" directory.
Therefore, save all directories and files in this directory. Save the directories and files so that when you restore the configuration information, the directories and files in the "$TMP_DIR\Manager\var\opt\FJSVssmgr\current\vsccompose" directory are restored in the same directory and file configuration as when saved.

Example

Example of commit script

@echo off
rem #
rem # All Rights Reserved, Copyright (c) Fujitsu Ltd. 2006-2009
rem #
rem # Storage Software Virtual Storage Conductor
rem #
rem # CommitScript Sample
rem #
rem ########################################################
setlocal

set VARDIR=$TMP_DIR\Manager
if not exist "%VARDIR%" goto fail
set CURRENT_DIR=%VARDIR%\var\opt\FJSVssmgr\current
set BKUP_DIR=vsclog\VSCCOMPOSE_BAK
set COMPOSE_DIR=vsccompose

set /a listflag=0
set /a delflag=0
set /a copyflag=0

cd "%CURRENT_DIR%"

:: backup check
if not exist "%BKUP_DIR%" mkdir "%BKUP_DIR%"
if errorlevel 1 goto fail

if not exist "%BKUP_DIR%\*.repository" goto allbackup

:: commitlist check
set COMMITLIST_DIR=commitlist
set INSERT_UPDATE_FILE=%COMMITLIST_DIR%\addlist.vsc
set DELETE_FILE=%COMMITLIST_DIR%\deletelist.vsc

if not exist "%COMMITLIST_DIR%" goto allbackup
if not exist "%COMMITLIST_DIR%\*.vsc" goto allbackup

if exist "%INSERT_UPDATE_FILE%" (for %%F in ( %INSERT_UPDATE_FILE% ) do if not %%~zF==0 set /a listflag =  1 && set /a copyflag = 1)
if exist "%DELETE_FILE%" (for %%F in ( %DELETE_FILE% ) do if not %%~zF==0 set /a listflag = 1 && set /a delflag = 1)

if %listflag% == 0 (goto allbackup) else goto diffbackup

:allbackup
if exist "%BKUP_DIR%\*.repository" del "%BKUP_DIR%\*.repository"
copy /y "%COMPOSE_DIR%\*.repository" "%BKUP_DIR%" > nul
if errorlevel 1 goto fail
if errorlevel 0 goto success

:diffbackup
if %delflag% == 1 (for /f "tokens=* delims=" %%F in ( %DELETE_FILE% ) do ((del "%BKUP_DIR%\%%F") & (if exist "%BKUP_DIR%\%%F" goto allbackup)))
if %copyflag% == 1 (for /f "tokens=* delims=" %%F in ( %INSERT_UPDATE_FILE%  ) do ((copy /y "%COMPOSE_DIR%\%%F" "%BKUP_DIR%" > nul) & (if errorlevel 1 goto allbackup)))

:success
if exist "%INSERT_UPDATE_FILE%" (del "%INSERT_UPDATE_FILE%")
if exist "%DELETE_FILE%" (del "%DELETE_FILE%")
echo "Backup Complete."
exit 0

:fail
echo "Backup failed."
exit 1

Note

Note that a commit script may cause a delay depending on its coding in VSC Manager processing time because it always starts up whenever there is a change in the resource status of virtual storage.

Information

  • $INS_DIR means "Program Directory" specified at the Manager installation.

  • $ENV_DIR means "Environment Directory" specified at the Manager installation.

  • $TMP_DIR means "Work Directory" specified at the Manager installation.