HP StorageWorks Storage Mirroring for Linux User's Guide (T2558-96078, February 2008)

12 - 10
SPOSTBACK.TXT (continued)
# Restore target data to source before #
# recreating original connection #
# Restore ID should be 1 or greater, so exit on failure #
$restID=RESTORE <repset> from <target> original <source> overwrite;
if $restID < 1 then
WRITE “restore failed from <target>”;
WRITE $restID;
quit;
end
SOURCE <source>;
WAITONRESTORE $restID;
# Add a hard wait of 20 seconds to clear queues. #
WAIT 20000;
# Successful source returns 0, so exit on failure #
$ret = SOURCE <source>;
if $ret < 0 then
WRITE “Could not source <source>”;
WRITE $ret;
quit
end
# Re-create original connection #
# Connection ID should be 1 or greater, so exit on failure #
$connectionID = CONNECT <repset> to <target> MAP EXACT NOMIRROR;
if $connectionID < 1 then
WRITE “Could not connect <repset> to <target>”;
WRITE $connectionID;
quit;
end
# Successful mirror start returns 0, so exit on failure #
$ret = MIRROR START $connectionID DIFFERENT, CHECKSUM;
if $ret < 0 then
WRITE “Could not start mirror to <target>”;
WRITE $ret;
quit;
end
WAITONMIRROR $connectionID;
WRITE “All operations completed successfully”;