beautypg.com

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

Page 167

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 to match your server #
$level = LOGIN ;
if $level < 2 then
WRITE “full access denied on ”;
WRITE $level;
quit;
end

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

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

This manual is related to the following products: