Chat now with support
Chat with Support

Rapid Recovery 6.1.3 - User Guide

Introduction to Rapid Recovery Core Console Core settings Repositories Encryption keys Protecting machines
About protecting machines with Rapid Recovery Support for dynamic and basic volumes Understanding the Rapid Recovery Agent software installer Deploying Agent to multiple machines simultaneously from the Core Console Using the Deploy Agent Software Wizard to deploy to one or more machines Modifying deploy settings Understanding protection schedules Protecting a machine About protecting multiple machines Settings and functions for protected Exchange servers Settings and functions for protected SQL servers
Managing protected machines Snapshots and recovery points Replication Events Reporting VM export Restoring data Bare metal restore
Bare metal restore for Windows machines Understanding boot CD creation for Windows machines Using the Universal Recovery Console for a BMR Performing a bare metal restore for Linux machines Viewing the recovery progress Starting a restored target server Troubleshooting connections to the Universal Recovery Console Repairing boot problems Performing a file system check on the restored volume
Managing aging data Archiving Cloud storage accounts The Local Mount Utility The Central Management Console Core Console references Command Line Management utility PowerShell module
Prerequisites for using PowerShell Working with commands and cmdlets Rapid Recovery PowerShell module cmdlets Localization Qualifiers
Scripting REST APIs About us Glossary

Using Bourne shell and Bash scripting with Rapid Recovery

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.

Bourne Again Shell (Bash) is a similar shell language that implements the same grammar, parameter, and variable expansion, redirection and quoting. Bash also uses the same .sh file extension. The information here applies equally to Bash.

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.

You can add available objects from the TransferPrescript parameter or add your own commands to the PreTransferScript.sh and PostTransfer.sh scripts to customize them.

Only PreTransferScript and PostTransferScript receive parameters. The snapshot and export scripts do not.

This section describes the scripts that administrators can use at designated occurrences in Rapid Recovery for Windows and Linux. It includes the following topics:

Prerequisites for shell scripting

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.

Execution timing for pre and post scripts

For context, the following diagram shows the difference in timing for running pre and post transfer and snapshot scripts.

Figure 8. When pre and post scripts execute

When pre and post scripts execute

Supported transfer and post-transfer script parameters

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.

Testing shell scripting

You can test the scripts you want to run by using the editor for the script (.sh) files.

Input parameters for shell scripting

The parameters for shell scripting in Rapid Recovery are described in the following tables.

TransferPrescriptParameters_VolumeNames

The following table presents the available objects for the TransferPrescript parameter.

Table 317. TransferPrescript objects

Method

Description

public VolumeNameCollection VolumeNames (get; set; )

Gets or sets the collection of volume names for transfer.

VolumeNames is a data structure that contains the following data:

public ShadowCopyType ShadowCopyType { get; set; }

Gets or sets the type of copying for transfer. ShadowCopyType is an enumeration with values. The available values are:

public string Key { get; set; }

The Key method generates a pseudorandom (but not cryptographically secure) key, which can be used as a one-time password to authenticate transfer requests.

public bool ForceBaseImage { get; set; }

Gets or sets the value indicating whether the transfer was a forced base image capture.

public bool IsLogTruncation { get; set; }

Gets or sets the value indicating whether logging is being truncated.

public uint LatestEpochSeenByCore { get; set; }

Gets or sets latest epoch value.

The LatestEpochSeenByCore method is the ordinal number of the most recent snapshot taken by the Core. This is the 'epoch number' assigned by the filter driver to this particular snapshot at the moment it was taken with VSS.

TransferPostscriptParameter

The following table presents the available objects for the TransferPostscript parameter.

Table 318. TransferPostscript objects

Method

Description

public VolumeNameCollection VolumeNames (get; set; )

Gets or sets the collection of volume names for transfer.

VolumeNames is a data structure that contains the following data:

public ShadowCopyType ShadowCopyType { get; set; }

Gets or sets the type of copying for transfer.ShadowCopyType is an enumeration with values. The available values are:

public string Key { get; set; }

The Key method generates a pseudorandom (but not cryptographically secure) key, which can be used as a one-time password to authenticate transfer requests.

public bool ForceBaseImage { get; set; }

Gets or sets the value indicating whether the transfer was a forced base image capture.

public bool IsLogTruncation { get; set; }

Gets or sets the value indicating whether logging is being truncated.

public uint LatestEpochSeenByCore { get; set; }

Gets or sets latest epoch value.

The LatestEpochSeenByCore method is the ordinal number of the most recent snapshot taken by the Core. This is the 'epoch number' assigned by the filter driver to this particular snapshot at the moment it was taken with VSS.

Sample shell scripts

This section describes the sample shell scripts available for administrative users to run on protected machines.

The sample scripts for protected machines include:

PreTransferScript.sh

The PreTransferScript is run on the protected Linux machine immediately before the backup snapshot transfer begins.

The following script stores the values from input parameters in PreTransferScriptResult.txt, which is stored in the root home directory.

Sample PreTransferScript

Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating