Automating restore, Automating restore -9 – HP Storage Mirroring V5 Software User Manual

Page 167

Advertising
background image

12

-

9

Automating Restore

You can use a post-failback script on the source to automate the restore process. Use the following file as a sample.

SPOSTBACK.TXT

# SAMPLE SOURCE FAILBACK AND RESTORE SCRIPT #
# #
# THIS POST-FAILBACK SCRIPT EXECUTES ON THE SOURCE. #
# THIS SCRIPT PERFORMS A TARGET-SOURCE RESTORE AND #
# REESTABLISHES THE CONNECTION AND STARTS MIRRORING. #
# YOU NEED THE FOLLOWING INFORMATION TO EDIT THIS SCRIPT: #
# target #
# source #
# repset #
# username #
# password #
# #

# Login to source machine #
# Full access level will return 2, so exit on failure #
# Change <source><username><password> to match your server #
$level = LOGIN <source> <username> <password>;
if $level < 2 then
WRITE “full access denied on <source>”;
WRITE $level;
quit;
end

# Login to target machine #
# Full access level will return 2, so exit on failure #
# Change <target><username><password> to match your server #
$level = LOGIN <target> <username> <password>;
if level < 2 then
WRITE “Full access denied on <target>”;
WRITE $level;
quit;
end

# Successful source returns 0, so exit on failure #
$ret = SOURCE <source>;
if $ret < 0 then
WRITE “Could not source <source>”;
WRITE $ret;
quit;
end

Advertising
This manual is related to the following products: