HP StorageWorks Storage Mirroring Recover Scripting Guide (T5437-96022, November 2010)

Creating a backup or snapshot of the target by
inserting a task command during replication
The following script stops the services on the source, pauses the script to allow the
source time to write the remaining application data to disk, inserts a Storage Mirroring
Recover task command into the Storage Mirroring Recover replication process, and then
restarts the services.
REM Stop the services on the source so that data changes
REM are stopped.
net stop "Service Name 1"
net stop "Service Name 2"
net stop "Service Name 3"
net stop "Service Name 4"
REM Pause the source (for a specified number of seconds) to
REM allow time for the application data to be written to
REM disk. The sleep command is available from the Windows
REM Resource Kit.
sleep 120
REM At this point the source application is stable
REM (service is stopped and data is written). Now, initiate
REM your Storage Mirroring Recover task
REM command, for example to trigger a snapshot or backup.
REM The process you want to run on the target must be
REM contained in the batch file specified in the queuetask
REM command. That batch file must be stored on the target
REM so that it can be executed on the target.
C:\Program Files\StorageWorks\Storage Mirroring\dtcl $TheSource = "alpha"
C:\Program Files\StorageWorks\Storage Mirroring\dtcl $TheTarget = "beta"
C:\Program Files\StorageWorks\Storage Mirroring\dtcl $TheUserName =
"administrator"
C:\Program Files\StorageWorks\Storage Mirroring\dtcl $ThePassword =
"password"
C:\Program Files\StorageWorks\Storage Mirroring\dtcl $TheDomain =
"domain.com"
C:\Program Files\StorageWorks\Storage Mirroring\dtcl login $TheSource
$TheUserName $ThePassword $TheDomainName
C:\Program Files\StorageWorks\Storage Mirroring\dtcl login $TheTarget
$TheUserName $ThePassword $TheDomainName
C:\Program Files\StorageWorks\Storage Mirroring\dtcl queuetask backup to
$TheTarget onexecute=Backup.bat timeout=forever
REM Now that the task command has been inserted inline