Bourne shell (sh) is a shell language or command-line interpreter for Unix-based operating systems. Bourne shell is used in Rapid Recovery with Linux to customize environments and specify certain operations to occur in a predetermined sequence. The .sh is the file extension and naming convention for Bourne shell files.
Using pre and post transfer, pre and post snapshot, and post export script hooks, you can perform system operations before and after a transfer or snapshot, or after virtual export. For example, you may want to disable a certain cronjob while a transfer is occurring and enable it once the transfer has finished. As another example, you may need to run commands to flush application-specific data to disk. The contents are written to a temporary file and run using exec. The script then runs using the interpreter defined in the first line of the script, for example, (#!/usr/bin/env bash). If the specified interpreter is not available, the script uses the default shell defined in the $SHELL environment variable.
You can substitute and use any interpreter. For example, on the #! line of the script, you can replace “bash” with “zsh” (Z shell), “tcsh” (tee shell), and so on, based on your preference.
This section describes the scripts that administrators can use at designated occurrences in Rapid Recovery for Windows and Linux. It includes the following topics:
Rapid Recovery provides the ability to run Bourne shell, Bash, and other shell scripts on a protected Linux machine before and after a transfer. The following scripts are supported for Linux machines protected with the Rapid Recovery Agent software.
To use these scripts, ensure that they reside in the /opt/apprecovery/scripts/ directory.
Figure 8. When pre and post scripts execute
The following parameters are supported on Linux for transfer scripts. For more information, see Sample shell scripts.
• |
• |
The following parameters are supported on Linux for post transfer scripts.
• |
• |
• |
You can test the scripts you want to run by using the editor for the script (.sh) files.
The parameters for shell scripting in Rapid Recovery are described in the following tables.
The following table presents the available objects for the TransferPrescript parameter.
The following table presents the available objects for the TransferPostscript parameter.
Gets or sets the collection of volume names for transfer. VolumeNames is a data structure that contains the following data: | |||||||
| |||||||
Gets or sets the value indicating whether the transfer was a forced base image capture. | |||||||
Gets or sets the value indicating whether logging is being truncated. | |||||||
The sample scripts for protected machines include:
© ALL RIGHTS RESERVED. Feedback Terms of Use Privacy