Edit the LUN protected group consistency script by referring to this chapter and the default script.
Linux
When editing the customized script, you are advised to run the . "$2/bin/agent_thirdpartyfunc.sh" command to initialize the script to ensure that the variables and functions in the script are available.
Table 1 and Table Function list show the available variables and functions after the script is initialized.
Name |
Description |
|---|---|
PID |
Unique ID |
AGENTROOT |
Root directory of the eReplication Agent |
BINPATH |
bin directory of the eReplication Agent |
TMPPATH |
Temporary file directory of the eReplication Agent |
LOGPATH |
Log directory of the eReplication Agent |
LOG_FILE_NAME |
Name of a log file |
RSTFILE |
Temporary file that stores the error message returned by the script to the eReplication Agent |
INPUT_PARA_TEMP_FILE |
Temporary file that stores variables |
INPUT_PARAMETER_LIST |
Stores all variables transferred from the eReplication Agent to the script. |
Name |
Description |
Example |
|---|---|---|
GetValue |
Obtains the value of input parameter key. |
GetValue "${INPUT_PARAMETER_LIST}" key username=$ArgValue |
Log |
Displays logs. |
Log "message" |
Exit |
Exits the script execution and displays logs.
|
Exit 1 -log "loginfo" -ret "result info" |
Windows
When editing the customized script, you are advised to run the call %~1\bin\agent_thirdpartyfunc.bat -init %~1 %~2 command to initialize the script to ensure that the variables and functions in the script are available.
After the script is initialized, the available variables and functions are shown in Table 3 and Table Function list.
Name |
Description |
|---|---|
PID |
Unique ID |
AGENT_ROOT |
Root directory of the eReplication Agent |
AGENT_BIN_PATH |
bin directory of the eReplication Agent |
AGENT_LOG_PATH |
Log directory of the eReplication Agent |
AGENT_TMP_PATH |
Temporary file directory of the eReplication Agent |
COMMONFUNC |
Script path of the public function |
PARAM_FILE |
Temporary file that stores variables |
RSTFILE |
Temporary file that stores the error message returned by the script to the eReplication Agent |
LOGFILE |
Log file name |
LOGFILEPATH |
Full log path |
INPUTINFO |
Stores all variables transferred from the eReplication Agent to the script. |
Name |
Description |
Example |
|---|---|---|
Init |
Initializes the script. |
call %~1\bin\agent_thirdpartyfunc.bat -init %~1 %~2 |
GainValue |
Obtains the value of input parameter key. |
call %COMMONFUNC% "%AGENT_ROOT%" %CMD_GETVALUE% %PID% %LOGFILE% "!INPUTINFO!" "key" DBINSTANCE |
Log |
Displays logs. |
call %~1 \bin\agent_thirdpartyfunc.bat -log "message" |
Exit |
Exits the script and displays logs. |
call %~1 \bin\agent_thirdpartyfunc.bat -exit -log "message" -ret %RSTCODE% 1 |
key is the keyword, and var is the variable that stores the variable value.