HP StorageWorks Storage Mirroring Recover Scripting Guide (T5437-96009, November 2009)
176 of 332
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.
REMStop 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"
REMPause the source (for a specified number of seconds) to
REMallow time for the application data to be written to
REMdisk. The sleep command is available from the Windows
REMResource 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
REMcommand, for example to trigger a snapshot or backup.
REMThe process you want to run on the target must be
REMcontained in the batch file specified in the queuetask
REMcommand. That batch file must be stored on the target
REMso 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