Backup

 

Pre- and Post-Exec Commands

Environment

The following environment variables are exported, and can be used in

Variables

the pre- and post-execscripts for an object on the system where the

 

Disk Agent is running:

 

BDACC

 

The Disk Agent sets its exit code (0 is successful) to the BDACC

 

environment variable. This variable can be checked in the post-exec

 

script, thus making the post-execcommand dependent on the

 

successful termination of the Disk Agent.

 

 

NOTE

If you perform a host backup, the pre-execscript is started once, before

 

the first filesystem backup for the particular system, while the

 

post-execscript is started after the backup. In this case, BDCACC

 

cannot be exported because the variable is related to a single filesystem

 

object, not to a whole client.

 

 

Key Points

Check the following key points before configuring the pre- and

 

post-exec commands:

 

The pre- and post-execcommands for an object are executed during

 

the preview of a backup. Therefore, you may want to preview your

 

backup first and then add the pre- and post-execcommands, or

 

check the PREVIEW environment variable in your scripts.

 

If a pre-execcommand for an object fails (returns a non-zero value),

 

the backup status of the object is set to Aborted and the Disk Agent

 

stops processing. No backup of the object exists.

 

If a post-execcommand fails (returns a non-zero value), the backup

 

status of the object is set to Aborted. A backup of the object exists and

 

data can be restored.

 

The pre- and post-execcommands should send some output to the

 

Disk Agent at least every 120 minutes by default, or the backup of the

 

object is aborted. This time period can be changed by modifying the

 

SmDaIdleTimeout variable in the global options file.

 

Pre- and post-execcommands are handled in the same way as

 

commands entered at the shell prompt. Special shell characters, such

 

as the pipe () and the redirect symbols (>,<) are not allowed.

 

While the pre- and post-execcommands are running, the backup

 

session cannot be aborted.

Chapter 5

261

Page 291
Image 291
HP B6960-90078 manual Environment, Variables