Source:Using Pre and Post Scripts: Difference between revisions

From SEPsesam
(Excluded items from printing and remarked for translation.)
(Fixed formatting.)
(36 intermediate revisions by the same user not shown)
Line 1: Line 1:
<div class="noprint">{{draft}}
<noinclude><translate><!--T:1-->
<div class="noprint"><languages />
{{Copyright SEP AG en}}
{{Copyright SEP AG en}}


{{Navigation_latest|release=4.4.3 to 4.4.3 ''Tigon V2''|link=[[Special:MyLanguage/SEP_sesam_Documentation#previous|Documentation archive]]}}</div>
<!--T:2-->
{{Navigation_latest|release=[[Special:MyLanguage/SEP_sesam_Release_Versions|4.4.3/4.4.3 ''Beefalo V2'']]
|link=[[Special:MyLanguage/SEP_sesam_Documentation#previous|Documentation archive]]}}</div>




== Overview==
<!--T:3-->
<div class="boilerplate metadata" id="Additional resources" style="background-color: #f0f0f0; color:#636f73; border: 1px ridge #cdd3db; margin: 0.5em; padding: 0.5em; float: right; width: 35%; "><center><b>Additional resources</b></center>
</noinclude>=== Overview===</translate>
<noinclude><div class="boilerplate metadata" id="Additional resources" style="background-color: #f0f0f0; color:#636f73; border: 1px ridge #cdd3db; margin: 0.5em; padding: 0.5em; float: right; width: 35%; "><center><b><translate><!--T:4-->
Additional resources</translate></b></center>
{|style="margin: auto; margin-bottom:1em; width:100%; border:0px solid grey;"
{|style="margin: auto; margin-bottom:1em; width:100%; border:0px solid grey;"
| rowspan="2" style="padding:0px 10px 0px;" |[[File:SEP_next.png|45px|link=Special:MyLanguage/Configuration_4.4#Interfaces|Interfaces]]
| rowspan="2" style="padding:0px 10px 0px;" |<translate><!--T:5-->
[[File:SEP_next.png|45px|link=Special:MyLanguage/4_4_3_Beefalo:Configuration#interfaces|Interfaces]]</translate>
| style="padding:0px 40px 0px 10px; color: grey; font-size: 90%; text-align:left;" |
| style="padding:0px 40px 0px 10px; color: grey; font-size: 90%; text-align:left;" |
See also: [[Special:MyLanguage/Configuration_4.4#Interfaces|Interfaces]] – [[Special:MyLanguage/Activities_4.4#pre_post|Pre/post options]] –  [[Special:MyLanguage/Online_backup_of_virtual_XEN_machines#command_line|Online backup of virtual XEN machines: Using Command Line Pre- and Post- Options]] – [[Special:MyLanguage/OwnCloud_Single_File_Restore#pre_post|Configuring ownCloud restore]]
<translate><!--T:6-->
See also: [[Special:MyLanguage/4_4_3_Beefalo:Configuration#interfaces|Interfaces]] – [[Special:MyLanguage/4_4_3_Beefalo:Activities#pre_post|Pre/post options]] –  [[Special:MyLanguage/OwnCloud_Single_File_Restore#pre_post|Configuring ownCloud restore]]</translate>
|}
|}


{|style="margin: auto; margin-bottom:1em; width:100%; border:0px solid grey;"
{|style="margin: auto; margin-bottom:1em; width:100%; border:0px solid grey;"
| rowspan="2" style="padding:0px 10px 0px;" | [[File:SEP Tip.png|45px|link=Special:MyLanguage/FAQ|FAQ]]
| rowspan="2" style="padding:0px 10px 0px;" | <translate><!--T:7-->
[[File:SEP Tip.png|45px|link=Special:MyLanguage/FAQ|FAQ]]</translate>
| style="padding:0px 40px 0px 10px; color: grey; font-size: 90%; text-align:left;" |
| style="padding:0px 40px 0px 10px; color: grey; font-size: 90%; text-align:left;" |
Check [[Special:MyLanguage/FAQ|FAQ]] to find the answers to most common questions.
<translate><!--T:8-->
Check [[Special:MyLanguage/FAQ|FAQ]] to find the answers to most common questions.</translate>
|}
|}


{|style="margin: auto; margin-bottom:1em; width:100%; border:0px solid grey;"
{|style="margin: auto; margin-bottom:1em; width:100%; border:0px solid grey;"
| rowspan="2" style="padding:0px 10px 0px;" | [[File:SEP Troubleshooting.png|45px|link=Special:MyLanguage/Troubleshooting_Guide#Backup_problems|Trobleshooting Guide]]
| rowspan="2" style="padding:0px 10px 0px;" | <translate><!--T:9-->
[[File:SEP Troubleshooting.png|45px|link=Special:MyLanguage/Troubleshooting_Guide|Trobleshooting Guide]]</translate>
| style="padding:0px 40px 0px 10px; color: grey; font-size: 90%; text-align:left;" |
| style="padding:0px 40px 0px 10px; color: grey; font-size: 90%; text-align:left;" |
Problems? Check the [[Special:MyLanguage/Troubleshooting_Guide|Troubleshooting Guide]].
<translate><!--T:10-->
|}</div>
Problems? Check the [[Special:MyLanguage/Troubleshooting_Guide|Troubleshooting Guide]].</translate>
|}</div></noinclude>
<translate><!--T:11-->
SEP sesam enables system administrators to perform additional actions before and/or after a backup or restore by using [[Special:MyLanguage/SEP_sesam_Glossary#pre|pre]] or [[Special:MyLanguage/SEP_sesam_Glossary#post|post]] scripts.  
SEP sesam enables system administrators to perform additional actions before and/or after a backup or restore by using [[Special:MyLanguage/SEP_sesam_Glossary#pre|pre]] or [[Special:MyLanguage/SEP_sesam_Glossary#post|post]] scripts.  


<!--T:12-->
''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.  
''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.  


<!--T:13-->
''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.
''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.


<!--T:14-->
Pre and post scripts are represented as one of SEP sesam [[Special:MyLanguage/SEP_sesam_Glossary#interfaces|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.
Pre and post scripts are represented as one of SEP sesam [[Special:MyLanguage/SEP_sesam_Glossary#interfaces|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.  
<!--T:15-->
{{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.}}
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.</translate>
{{<translate><!--T:16-->
note</translate>|<translate><!--T:17-->
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.</translate>}}
<translate><!--T:18-->
To use the pre/post script, you have to activate the relevant interface first and then create your own script.
To use the pre/post script, you have to activate the relevant interface first and then create your own script.


=={{anchor|configuration}}Configuring pre and post scripts==
==={{anchor|configuration}}Configuring pre and post scripts=== <!--T:19-->
 
<!--T:20-->
SEP sesam provides several interface templates. They are located in the SEP sesam directory {{path|<SESAM_ROOT>/skel/templates}}. You can activate them automatically via GUI (recommended) or manually by copying them.
SEP sesam provides several interface templates. They are located in the SEP sesam directory {{path|<SESAM_ROOT>/skel/templates}}. You can activate them automatically via GUI (recommended) or manually by copying them.


==={{anchor|GUI}}Activating ''interfaces'' via SEP sesam GUI===
===={{anchor|GUI}}Activating ''interfaces'' via SEP sesam GUI==== <!--T:21--></translate>
<ol><li>From '''Configuration''' -> '''Interfaces''', select the relevant interface type (''Pre'' or ''Post'') that you want to activate.</li>
<ol><li><translate><!--T:22-->
[[Image:Configuration_interfaces_pre.png|link=]]
From '''Configuration''' -> '''Interfaces''', select the relevant interface type (''Pre'' or ''Post'') that you want to activate.</translate><br />
 
<translate><!--T:23-->
[[Image:Activating_interfaces_Beefalo_V2.jpg|800px|link=]]</translate>
<br clear=all>
<br clear=all>
<li>The ''Edit Pre/Post Interface'' window opens: Select '''Backup''' or '''Restore Interface''' and the '''client''' on which you want to run the script. Click '''OK'''.</li>
</li>
[[Image:Edit_pre_interface.png|link=]]
<li><translate><!--T:24-->
The ''Edit Pre/Post Interface'' window opens: Select '''Backup''' or '''Restore interface''' and the '''client''' on which you want to run the script. Click '''OK'''.</translate><br />
 
<translate><!--T:25-->
[[Image:Edit_pre_interface_Beefalo_V2.jpg|300px|link=]]</translate>
<br clear=all>
<br clear=all>
<li>A new window with the '' Edit <name> interface script'' opens, allowing you to configure (insert) specific action at the end of the script.</li>
</li>
{{note|
<li><translate><!--T:26-->
*Before the end of the procedure either <tt>STATUS:OK</tt> or <tt>STATUS:ERROR</tt> {text} must be written to standard output.
A new window with the '' Edit <name> interface script'' opens, allowing you to configure (insert) specific action at the end of the script.</translate><br />
*If you want to change a backup source, <tt><nowiki>STATUS: messages</nowiki></tt> have to includes keyword <tt><nowiki>BACKUP_SRC=</nowiki></tt>, for example, <tt><nowiki>STATUS:OK BACKUP_SRC=C:,F:/DATA</nowiki></tt>. It this case the backup will use this source instead of the source defined in a backup task.}}
{{<translate><!--T:27-->
[[Image:Pre_interface.png|link=]]
note</translate>|
<br clear=all>  
*<translate><!--T:28-->
<ul><li>For example, you may want to shut down a specific computer after the backup is finished. To configure this action, you have to select '''Post backup interface''' for a relevant client and add the following lines at the end of the <tt>sbc_post</tt> script:
Before the end of the procedure either <tt>STATUS:OK</tt> or <tt>STATUS:ERROR</tt> {text} must be written to standard output.</translate>
<ul><li>For Windows</li>
 
  #=== Please insert your specific actions here =====================================
*<translate><!--T:29-->
If you want to change a backup source, <tt><nowiki>STATUS: messages</nowiki></tt> have to includes keyword <tt><nowiki>BACKUP_SRC=</nowiki></tt>, for example, <tt><nowiki>STATUS:OK BACKUP_SRC=C:,F:/DATA</nowiki></tt>. It this case the backup will use this source instead of the source defined in a backup task.</translate>}}
 
<translate><!--T:30-->
[[Image:Pre_interface_Beefalo_V2.jpg|link=]]</translate>
<br clear=all>
</li>
<ul><li><translate><!--T:31-->
For example, you may want to shut down a specific computer after the backup is finished. To configure this action, you have to select '''Post backup interface''' for a relevant client and add the following lines at the end of the <tt>sbc_post</tt> script:</translate>
 
<ul><li><translate><!--T:32-->
For Windows</translate></li>
  #=== Please insert your specific actions here =====================================  
  echo "shutdown -s -t 120"
  echo "shutdown -s -t 120"
  shutdown -s -t 120
  shutdown -s -t 120
Line 61: Line 100:
  echo STATUS:OK
  echo STATUS:OK
  exit
  exit
<li>For Linux:</li>
<li><translate><!--T:33-->
For Linux:</translate></li>
  echo "shutdown -h +2"
  echo "shutdown -h +2"
  shutdown -h +2
  shutdown -h +2
</ul></ul>
</li></li></ul></ul>
This action invokes a shutdown of the computer two minutes after the backup has finished.  
<li><translate><!--T:34-->
<ul><li>The first line <tt>shutdown ...</tt> is the message which is written in the ''Post log file'' during the backup.</li>  
This action invokes a shutdown of the computer two minutes after the backup has finished.</translate>
<li>If the post process ends with an error, the backup will complete with status <tt>Warning</tt>.</li>
<ul><li><translate><!--T:35-->
</ul>
The first line <tt>shutdown ...</tt> is the message which is written in the ''Post log file'' during the backup.</translate></li>  
<li>After configuring a relevant pre or post action, click '''Save''' to activate the interface on a specific client.</li>  
<li><translate><!--T:36-->
</ol>
If the post process ends with an error, the backup will complete with status <tt>Warning</tt>.</translate></li></li></ul>
<li><translate><!--T:37-->
After configuring a relevant pre or post action, click '''Save''' to activate the interface on a specific client.</translate></li>
</li></ol>
<translate><!--T:38-->
Upon saving the template the script is read and copied to the {{path|<SESAM_ROOT>/bin/sesam}}. Now you have to [[#select|add a pre/post script to backup or restore tasks]].  
Upon saving the template the script is read and copied to the {{path|<SESAM_ROOT>/bin/sesam}}. Now you have to [[#select|add a pre/post script to backup or restore tasks]].  


For more examples on how to use pre and post scripts, see [[Special:MyLanguage/Online_backup_of_virtual_XEN_machines#command_line|Online backup of virtual XEN machines: Using Command Line Pre- and Post- Options]] and [[Special:MyLanguage/OwnCloud_Single_File_Restore#pre_post|Configuring ownCloud restore]].
<!--T:39-->
For more examples on how to use pre and post scripts, see [[Special:MyLanguage/OwnCloud_Single_File_Restore#pre_post|Configuring ownCloud restore]].
 
===={{anchor|copy}}Activating interfaces manually==== <!--T:40-->


==={{anchor|copy}}Activating interfaces manually===
<!--T:41-->
Alternatively, you can activate the interfaces by copying the existing templates from the SEP sesam directory {{path|<SESAM_ROOT>/skel/templates}} under the names:
Alternatively, you can activate the interfaces by copying the existing templates from the SEP sesam directory {{path|<SESAM_ROOT>/skel/templates}} under the names:</translate>
  sbc_pre
  sbc_pre
  sbc_post
  sbc_post
to the directory {{path|<SESAM_ROOT>/bin/sesam}}.  
<translate><!--T:42-->
to the directory {{path|<SESAM_ROOT>/bin/sesam}}.


=={{anchor|select}}Selecting a pre/post script for backup or restore==
==={{anchor|select}}Selecting a pre/post script for backup or restore=== <!--T:43-->


<!--T:44-->
After configuring desired pre/post actions, specify whether any pre or post script should be applied on a specific client, by adding the script to backup or restore task.
After configuring desired pre/post actions, specify whether any pre or post script should be applied on a specific client, by adding the script to backup or restore task.


==={{anchor|bck}}Selecting a pre/post script for backup===
===={{anchor|bck}}Selecting a pre/post script for backup==== <!--T:45-->
 
<!--T:46-->
You can select to run a pre/post script when creating a backup task or apply it to an already configured task. For details on how to create a new backup task, see [[Special:MyLanguage/Creating_a_Backup_Task|Creating a Backup Task]].</translate>


You can select to run a pre/post script when creating a backup task or apply it to an already configured task. For details on how to create a new backup task, see [[Special:MyLanguage/Creating_a_Backup_Task|Creating a Backup task]].
<ol><li><translate><!--T:47-->
From '''Main Selection'''-> '''Tasks'''-> '''By Clients''', select your client and '''double-click it''' or click '''New Backup Task'''. The ''Properties'' or ''New Backup Task'' window opens. Switch to the ''Options'' tab.</translate><br />


<ol><li>From '''Main Selection'''-> '''Tasks'''-> '''By clients''', select your client and '''double-click it''' or click '''New backup task'''. The ''Properties'' or ''New backup task'' window opens. Switch to the ''Options'' tab.</li>
<translate><!--T:48-->
[[Image:Tasks_options.png|link=]]
[[Image:Tasks_options_Beefalo_V2.jpg|730px|link=]]</translate>
<br clear=all>  
<br clear=all>  
<li>Depending on the desired action,  select either '''Execute pre''' or '''Execute post''' backup and/or restore option(s)::</li>
</li>
<ul><li>'''Execute pre:''' Enable it if you want to run the pre script for this backup task. </li>
<li><translate><!--T:49-->
<li>'''Execute post:''' Enable it if you want to run the post script for this backup task. </li>
Depending on the desired action,  select either '''Execute pre''' or '''Execute post''' backup and/or restore option(s):</translate>
<li>'''Ignore pre error:''' Enable it to allow to force start backup even if the pre-script was not properly executed.</li>
<li>'''Ignore backup error:''' Enable it to allow to execute the post script after a faulty backup.</li></ul>
<li>Click '''OK''' to activate the pre/post script execution for the selected task.</li></ol>


==={{anchor|restore}}Selecting a pre/post script for restore===
<ul><li><translate><!--T:50-->
'''Execute pre:''' Enable it if you want to run the pre script for this backup task.</translate>  </li>
<li><translate><!--T:51-->
'''Execute post:''' Enable it if you want to run the post script for this backup task.</translate>


You can select to run a pre/post script when creating a restore task or apply it to an already configured task (''Main Selection'' -> ''Job State'' -> ''Restores'' -> open ''Properties''). For details on how to create a new restore task, see  [[Special:MyLanguage/Standard_Restore_Procedure|Standard Restore Procedure]]. In both cases, you can select to run a pre/post script in the final ''Save and Start'' step of the restore wizard.
<li><translate><!--T:52-->
<ol><li>In the ''Save and start'' step of the restore wizard, click '''Expert options''' and then select the tab '''Pre/Post'''.
'''Ignore pre error:''' Enable it to allow to force start backup even if the pre-script was not properly executed.</translate></li>
[[Image:Restore_pre_post.png|link=]]
<li><translate><!--T:53-->
'''Ignore backup error:''' Enable it to allow to execute the post script after a faulty backup.</translate></li></ul></li>
<li><translate><!--T:54-->
Click '''OK''' to activate the pre/post script execution for the selected task.</translate></li></ol>
 
<translate>===={{anchor|restore}}Selecting a pre/post script for restore==== <!--T:55-->
 
<!--T:56-->
You can select to run a pre/post script when creating a restore task or apply it to an already configured task (''Main Selection'' -> ''Job State'' -> ''Restores'' -> open ''Properties''). For details on how to create a new restore task, see  [[Special:MyLanguage/Standard_Restore_Procedure|Standard Restore Procedure]]. In both cases, you can select to run a pre/post script under the ''Expert Options''.</translate>
{{<translate><!--T:66--> note</translate>|<translate><!--T:67--> As of v. [[Special:MyLanguage/SEP_sesam_Release_Versions|4.4.3. ''Beefalo'']], the ''Expert Options'' button for specifying advanced restore options is only available in the [[Special:MyLanguage/SEP_sesam_Glossary#UI_mode|''Expert'' UI mode]]. It is not available for users that run the GUI in ''Basic'' or ''Advanced'' mode. In the latter case, if you want to access the ''Expert Options'' you first have to change the ''Basic/Advanced'' UI mode to ''Expert'', as described in [[Special:MyLanguage/4_4_3_Beefalo:SEP_sesam_GUI#UI_mode|Selecting UI mode]].</translate>}}
<ol><li><translate><!--T:57-->
In the ''Target Settings'' (previously ''Save and Start'') dialog, click '''Expert Options''' and then select the tab '''Pre/Post'''.</translate><br />
 
<translate><!--T:58-->
[[Image:Restore_pre_post_Beefalo.jpg|630px|link=]]</translate>
<br clear=all>  
<br clear=all>  
<li>Depending on the desired action, select either '''Execute pre''' or '''Execute post''' restore option(s):</li>
</li>
<ul><li>'''Execute pre:''' Enable it if you want to run the pre script for this restore task.</li>
<li><translate><!--T:59-->
<li>'''Execute post:''' Enable it if you want to run the post script for this restore task.</li>
Depending on the desired action, select either '''Execute pre''' or '''Execute post''' restore option(s):</translate>
<li>'''Start restore in spite of pre error:'''  Enable it to allow to force start restore even if the pre-script was not properly executed.</li>
 
<li>'''Start post in spite of restore error:''' Enable it to allow to execute the post script after a faulty restore.</li></ul>
<ul><li><translate><!--T:60-->
<li>Click '''OK''' to activate the pre/post script execution for the selected task.</li></ol>
'''Execute pre:''' Enable it if you want to run the pre script for this restore task.</translate></li>
<li><translate><!--T:61-->
'''Execute post:''' Enable it if you want to run the post script for this restore task.</translate></li>
<li><translate><!--T:62-->
'''Start restore in spite of pre error:'''  Enable it to allow to force start restore even if the pre-script was not properly executed.</translate></li>
<li><translate><!--T:63-->
'''Start post in spite of restore error:''' Enable it to allow to execute the post script after a faulty restore.</translate></li></ul></li>
<li><translate><!--T:64-->
Click '''OK''' to activate the pre/post script execution for the selected task.</translate></li></ol>


<div class="noprint">
<noinclude><translate><div class="noprint">
== See also ==
=== See also === <!--T:65-->
[[Special:MyLanguage/Configuration_4.4#Interfaces|Interfaces]] – [[Special:MyLanguage/Activities_4.4#pre_post|Pre/post options]] – [[Special:MyLanguage/Online_backup_of_virtual_XEN_machines#command_line|Online backup of virtual XEN machines: Using Command Line Pre- and Post- Options]] – [[Special:MyLanguage/OwnCloud_Single_File_Restore#pre_post|Configuring ownCloud restore]]</div>
[[Special:MyLanguage/4_4_3_Beefalo:Configuration#interfaces|Interfaces]] – [[Special:MyLanguage/4_4_3_Beefalo:Activities#pre_post|Pre/post options]] –   [[Special:MyLanguage/OwnCloud_Single_File_Restore#pre_post|Configuring ownCloud restore]]</div></translate></noinclude>

Revision as of 09:10, 12 August 2020

Other languages:

Template:Copyright SEP AG en

Docs latest icon.png Welcome to the latest SEP sesam documentation version 4.4.3/4.4.3 Beefalo V2. For previous documentation version(s), check Documentation archive.


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.

Information sign.png 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

  1. From Configuration -> Interfaces, select the relevant interface type (Pre or Post) that you want to activate.
    Activating interfaces Beefalo V2.jpg
  2. The Edit Pre/Post Interface window opens: Select Backup or Restore interface and the client on which you want to run the script. Click OK.
    Edit pre interface Beefalo V2.jpg
  3. A new window with the Edit <name> interface script opens, allowing you to configure (insert) specific action at the end of the script.
    Information sign.png Note
    • Before the end of the procedure either STATUS:OK or STATUS:ERROR {text} must be written to standard output.
    • If you want to change a backup source, STATUS: messages have to includes keyword BACKUP_SRC=, for example, STATUS:OK BACKUP_SRC=C:,F:/DATA. It this case the backup will use this source instead of the source defined in a backup task.

    Pre interface Beefalo V2.jpg

    • For example, you may want to shut down a specific computer after the backup is finished. To configure this action, you have to select Post backup interface for a relevant client and add the following lines at the end of the sbc_post script:
      • For Windows
      • #=== Please insert your specific actions here ===================================== echo "shutdown -s -t 120" shutdown -s -t 120 rem echo STATUS:ERROR {message} echo STATUS:OK exit
      • For Linux:
      • echo "shutdown -h +2" shutdown -h +2
  4. This action invokes a shutdown of the computer two minutes after the backup has finished.
    • The first line shutdown ... is the message which is written in the Post log file during the backup.
    • If the post process ends with an error, the backup will complete with status Warning.
  5. After configuring a relevant pre or post action, click Save to activate the interface on a specific client.

Upon saving the template the script is read and copied to the <SESAM_ROOT>/bin/sesam. Now you have to add a pre/post script to backup or restore tasks.

For more examples on how to use pre and post scripts, see Configuring ownCloud restore.

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.

Selecting a pre/post script for backup or restore

After configuring desired pre/post actions, specify whether any pre or post script should be applied on a specific client, by adding the script to backup or restore task.

Selecting a pre/post script for backup

You can select to run a pre/post script when creating a backup task or apply it to an already configured task. For details on how to create a new backup task, see Creating a Backup Task.

  1. From Main Selection-> Tasks-> By Clients, select your client and double-click it or click New Backup Task. The Properties or New Backup Task window opens. Switch to the Options tab.
    Tasks options Beefalo V2.jpg
  2. Depending on the desired action, select either Execute pre or Execute post backup and/or restore option(s):
    • Execute pre: Enable it if you want to run the pre script for this backup task.
    • Execute post: Enable it if you want to run the post script for this backup task.
    • Ignore pre error: Enable it to allow to force start backup even if the pre-script was not properly executed.
    • Ignore backup error: Enable it to allow to execute the post script after a faulty backup.
  3. Click OK to activate the pre/post script execution for the selected task.

Selecting a pre/post script for restore

You can select to run a pre/post script when creating a restore task or apply it to an already configured task (Main Selection -> Job State -> Restores -> open Properties). For details on how to create a new restore task, see Standard Restore Procedure. In both cases, you can select to run a pre/post script under the Expert Options.

Information sign.png Note
As of v. 4.4.3. Beefalo, the Expert Options button for specifying advanced restore options is only available in the Expert UI mode. It is not available for users that run the GUI in Basic or Advanced mode. In the latter case, if you want to access the Expert Options you first have to change the Basic/Advanced UI mode to Expert, as described in Selecting UI mode.
  1. In the Target Settings (previously Save and Start) dialog, click Expert Options and then select the tab Pre/Post.
    Restore pre post Beefalo.jpg
  2. Depending on the desired action, select either Execute pre or Execute post restore option(s):
    • Execute pre: Enable it if you want to run the pre script for this restore task.
    • Execute post: Enable it if you want to run the post script for this restore task.
    • Start restore in spite of pre error: Enable it to allow to force start restore even if the pre-script was not properly executed.
    • Start post in spite of restore error: Enable it to allow to execute the post script after a faulty restore.
  3. Click OK to activate the pre/post script execution for the selected task.