Available only in WinBackup Professional and Server versions, the Actions Feature allows you to execute commands (Scripted Actions) before and/or after backup.  Scripted Actions can make life so much easier and more practical in the task of automating Backups. We will also present you with a number of such useful scripted actions that you can use in WinBackup.  See Examples of Scripted Actions.

 

WinBackup provides a facility to execute actions before and after a Backup Process is run. Those actions are usually a small group of instructions bundled together and referred to as scripts. They are basically helper utilities.  Examples of such scripted actions include:

• Shutting down your PC

• Closing a running application

• Starting a new application

 

The Scripting Interface

Scripted Actions are individually entered for each Backup Job. You can find the Scripting Interface by selecting the Backup Job for which you would like to add a script, on the Actions Icon () in the Work Area of WinBackup and you will find an Actions item on the left hand side of the Work Area sub-menu.

 

 

All You Need To Know

Execution Types

You have two entry fields in which you can write your scripted actions. One is for execution Before the Backup Job is run, the other After the Backup Job has run.

 

One Action per line

Scripted Actions are processed on a per line basis, meaning an action cannot extend beyond one line.

 

Line Syntax

The following syntax describes an Action line and its parts:

Action ;; prm ; prm ; prm ; …

 

where:

Action

An action can either be a path and filename specification such as c:\windows\notepad.exe or any other specification that has significance on a windows command prompt.

 

The difference is that any path and filename type action (such as a reference to Notepad) will be executed as a separate process whereas any other specification will be executed as if it had been specified in the Windows Start -> Run interface (essentially it is run as if typed in a Command Prompt Window).

 

 

 

You can test your action specification by typing it in a command prompt or in the Windows Start -> Run interface.

 

;; (double semicolon)

The double semicolon signals the WinBackup script parser that there are one or more parameters that customize the way in which the action is to be executed.

 

prm

Action Parameters customize the way in which actions are executed. Since an action can have more than one parameter, each parameter is separated by a single semicolon as described in the Syntax.

 

The following is a table of Parameters and their description:

Parameter

Description

show

Change the Action visibility to visible. This means that whatever the action executes will be visible.

nowait

Change the action execution to parallel meaning the WinBackup Script Processor will execute an Action line but does not wait for it to complete before proceeding to the next action.

task=

This parameter allows you to enter a descriptive text that will be displayed during execution as Status in the WinBackup User Interface.

timeout=

Specify a custom timeout value in seconds for how long the WinBackup Script Processor will wait before proceeding to the next Action line.

 

The default execution behavior of all actions is in sequence in a separate hidden process (hidden means without a User Interface, however you will still see the process in the Windows Task Manager). This means that each action line is executed one by one and the WinBackup Script Processor will wait for each action to complete before proceeding to the next.

 

Also note that each action has by default 10 seconds to complete before the WinBackup Script Processor will proceed. You can change this timeout value as described above.

 

Environment Variables

All Windows System and User Environment Variables are available as well as the following WinBackup Environment Variables:

%WINBACKUP%

This variable will be replaced with the Installation Path of WinBackup.

 

%JOB_NAME%

This variable will be replaced with the name of the current Backup Job.

 

%BACKUP_FILE%

This variable will be replaced with the path and filename of the Target Backup File. Note that this variable is only available in the Execute After Backup script.

 

%JOB_RESULT%

This variable will be replaced with a string specifying the result of the job execution (success or failure). Note that this variable is only available in the Execute After Backup script.

 

Examples of Scripted Actions

Example 1 – Windows Shutdown

The following is a script that will shutdown windows and can be used for execution after the backup process.

 

shutdown.exe –s –f –t 60 –c “Backup Completed”

 

You can lookup the shutdown application and its parameters in the windows help file by searching for shutdown. Alternatively open a command prompt window and type shutdown /?

 

Example 2 – Close Application (e.g. Microsoft Outlook)

The following is a script that will close an application and can be used for execution before the backup process. The example will close Microsoft Office Outlook.

 

taskkill.exe /f /im outlook.exe

 

You can lookup the taskkill application and its parameters in the windows help file by searching for taskkill. Alternatively open a command prompt window and type taskkill /?

 

 

To close any other application, simply change the application (executable) name in the script.

 

Example 3 – Start Application (e.g. Microsoft Outlook)

The following is a script that will start an application and can be used for execution after the backup process. The example will open Microsoft Office Outlook.

 

%programfiles%\Microsoft Office\Office11\outlook.exe

 

Simply change the application (executable) path and name in the script to start any other application.

 

 

Send us your feedback

The number of actions and scripts than can be created are numerous and support for various procedures can be very helpful. We are looking forward to hear from you and receive your examples and suggestions.

 

What's Next?

The WinBackup Scheduler