Backup server pre & post backup job programs, Creating pre & post backup programs – Storix Software SBAdmin User Guide User Manual
Page 61

Backup Server Pre & Post Backup Job programs
Server pre and post-backup programs are only available with
Network Edition
,
but
will be ignored for backup jobs sent to a
TSM Server
.
When a backup job using a profile containing a server pre-backup or post-backup job program is run, the
system will attempt to execute the specified program on the server before the first client backup (pre) or
after the last client backup (post). This allows you to perform operations such as initializing tape libraries
before backups are performed to the backup server. If the program does not exist on the server or is not
executable, it will be ignored. Otherwise, it will be executed and one of the following actions will be taken
depending on the exit code of the program:
Storix System Backup Administrator
61
Version 8.2 User Guide
Pre-backup Program
Post-backup Program
Exit code 0
Job will continue normally.
Job will complete successfully.
No clients will be backed up and job
will terminated with an error
Job will terminate with an error.
Exit code 1
Exit code 2
or higher
Client backups will continue. When
backup are complete, job will terminate
with a warning message.
Job will complete with warning messages only.
A post backup job program will be executed even if a client backup fails or another
error occurs. This is necessary in case the post-backup program must record
information about the backup or restart processes that were stopped by the pre-
backup program, etc.
Creating Pre & Post Backup Programs
A customized program may perform any function on the system since it is run under root user authority. Any
arguments or flags may be provided to the command. The same script may be called with arguments that
tell the script how to proceed. For example:
mypreprogram –kill
may be used to log off users and
mypreprogram –warn
may warn users of the backup only, or
mypreprogram –kill 60
may warn users, then log them off after 20 seconds, etc.
In many cases, it is desirable for the program to have certain information about the backup job. The
program may want to display or save information about the backup job in another application or file, or a
post-backup program may need to respond differently depending on whether the backup was successful or
not. Every program will have access to the following environment variables:
STX_CLIENT
The name of the client
STX_SERVER
The name of the backup server
STX_DEVICE
The name of the device on the server
STX_JOBID
The Job ID
STX_BACKUPID
The Backup ID
STX_EXITCODE
The exit code of the backup command or job
STX_SNAPDEVNAME
The device name for which a snapshot is created.
STX_SNAPFSNAME
The filesystem name (mount point) of the snapshot device.
This will show a dash "-" if the device is a logical volume without a filesystem.
The STX_EXITCODE variable is only used in client or server post-backup/job programs. For client
programs, this indicates the success or failure of the backup. On servers, indicates the success or failure of
the overall backup job.