All batch files, scripts, or commands for custom recovery steps that you add to a recovery plan must meet certain requirements.

When you create a command step to add to a recovery plan, make sure that it takes into account the environment in which it must run. Errors in a command step affect the integrity of a recovery plan. Test the command on Site Recovery Manager Server on the recovery site before you add it to the plan.

Site Recovery Manager for Windows

  • You must start the Windows command shell using its full path on the local host. For example, to run a script located in c:\alarmscript.bat, use the following command line:
    c:\windows\system32\cmd.exe /c c:\alarmscript.bat
  • You must install batch files and commands on the Site Recovery Manager Server at the recovery site.
  • Batch files and commands must finish within 300 seconds. Otherwise, the recovery plan ends with an error. To change this limit, see Change Recovery Settings.
  • Batch files or commands that produce output that contains characters with ASCII values greater than 127 must use UTF-8 encoding. Site Recovery Manager records only the final 4 KB of script output in log files and in the recovery history. Scripts that produce more output should redirect the output to a file rather than sending it to the standard output to be logged.

Site Recovery Manager Appliance

  • You must copy the script in the home directory of the admin user /home/admin.
  • You must change the access permission of the script so that the srm user can run it. For example, for a bash script, use the following command line:
    chmod 755 Myscript.sh
  • When you run the script, you must use the full path on the local host. For example, to run a bash script, use the following command:
    /bin/sh /home/admin/Myscript.sh