The Script plug-in allows the user to run custom commands as part of the backup process. Although Windows PowerShell is not currently supported within the Script plug-in, it is possible to use a PowerShell script to initiate a backup and to run commands both before and/or after the backup.
An example script is provided which makes i t possible to automate different outcomes to the script depending on the success status of the backup. The default script also includes an example command for shutting down the machine. See the excerpt below:
if( $backupStatus = "Successful" )
# If Backup was successful, run this command. Leave empty to do nothing.
# Shutdown machine e.g.:
if( $backupStatus = "Successful with warnings" )
# If Backup was successful with warnings, run this command. Leave empty to do nothing.
if( $backupStatus = "Failed" )
# If Backup failed, run this command. Leave empty to do nothing.
Download the standard script here.
To configure the Script in Task Scheduler:
- Create a folder to contain the scripts, for example a subdirectory in the installation directory (C:\Program Files\Attix5 Pro\Backup Client SE\scripts\).
- In the folder, create a file called "runbackup.bat", containing the following line:
powershell -ExecutionPolicy Unrestricted -File "C:\Program Files\Attix5 Pro\Backup Client SE\scripts\runbackup.ps1"
- In the same folder, save the PowerShell script file as "runbackup.ps1".
Note: If you do not want to shut the server down, ensure you remove the "Stop-Computer" example line from near the bottom of the file before running any scheduled tasks.
- In Windows Task Scheduler, create a task with a trigger at your desired backup time.
- In the Actions tab, set the Action to "Start a program" and select the "runbackup1.bat" script. No arguments are required.
- Set the task to "Run whether a user is logged on or not" and enter an Administrator username and password to save the task configuration.
Note: If you run the scripts from a different location, you will need to change the file path where the scripts are located.
Old Article ID: 267
Posted: 05 Aug, 2014 by Du Plessis S.
Updated: 19 Mar, 2015 by Du Plessis S.