Source:Using Pre and Post Scripts
Overview
SEP sesam enables system administrators to perform additional actions before and/or after a backup or restore by using pre or post scripts.
Pre backup scripts are executed before backup jobs starts to perform specific operation. Typically, they are used to create commands that will stop or start the selected programs, for example, to stop a database or an antivirus service before the backup. Similarly, pre restore scripts are executed before restore starts.
Post backup scripts are executed when the backup session stops to perform specific tasks, such as starting a database or shutting down a computer after the backup. Similarly, post restore scripts are executed after the restore is done, for example, to start a database.
Pre- and post scripts are represented as one of SEP sesam interfaces. These are configurable programs which can be programmed by using any text editor. Pre and post scripts are not provided by SEP sesam; you must create your own scripts to perform the desired actions.
Unlike other SEP sesam interfaces, the pre/post interfaces relate to a specific client only; they are created for each client individually and are only executed on the selected client.
Note | |
Configuring pre and/or post scripts is optional. The pre/post interface might affect backup or restore execution; when creating a script, have in mind that any pre/post script should not take a long time to complete as it can delay a backup or restore. |
To use the pre/post script, you have to activate the relevant interface first and then create your own script.
Configuring pre and post scripts
SEP sesam provides several interface templates. They are located in the SEP sesam directory <SESAM_ROOT>/skel/templates
. You can activate them automatically via GUI (recommended) or manually by copying them.
Activating interfaces via SEP sesam GUI
- From Configuration -> Interfaces, select the relevant interface type (Pre or Post) that you want to activate.
- A new window with the interface script opens. Click Save to activate the interface.
Upon saving the template the script is read and copied to the <SESAM_ROOT>/bin/sesam
.
Activating interfaces manually
Alternatively, you can activate the interfaces by copying the existing templates from the SEP sesam directory <SESAM_ROOT>/skel/templates
under the names:
sbc_pre sbc_post
to the directory <SESAM_ROOT>/bin/sesam
.