Backup

Pre- and Post-Exec Commands

How to Specify the For information on how to specify the commands, refer to the online Help

Filename or index keyword “pre- and post-exec commands for backup specifications”.

Pathname?

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

Variables pre- and post-execscripts for a backup specification session on any host:

DATALIST

The name of the backup specification.

MODE

Backup operation type, such as full, incremental,

 

incremental1, and so on.

OWNER

Owner of the session.

 

The content of this variable is in the same format as in

 

the database (case-sensitive):

 

<user>.<group>@<hostname> for UNIX and

 

<DOMAIN>\<user>@<hostname> for Windows NT.

PREVIEW

Set to 1, if the preview is running. Set to 0, if a backup

 

is running. Use this variable to modify your commands

 

so that they are executed only during a backup and not

 

during a preview. By default, pre- and post-exec

 

commands are not executed for preview. You can

 

enable this with global option ExecScriptOnPreview.

RESTARTED

Set to 1 if this is a restarted Backup session, otherwise

 

set to 0. The post-execcan use this variable to

 

prevent an additional restart if SMEXIT equals 0.

SESSIONID

Is used to identify a finished session and is recorded in

 

the database. You cannot use this to preview a session

 

(use SESSIONKEY).

SESSIONKEY

Is used to identify a running session. You may, for

 

example, abort a backup session before it is started if

 

something is wrong.

SMEXIT

The exit code of the Session Manager is the same as the

 

exit code of the omnib command. You can only use this

 

variable with the post-execcommand. Agents can

 

refer to Disk Agents, Media Agents, Application

 

Agents, and Symmetrix Agents. Refer to Table 5-3 on

 

page 253 for details on SMEXIT values.

258

Chapter 5