Scripts in Backup Manager

You can set up Backup Manager client to perform certain actions before or after backups. This is done with the help of scripts. You can use any command line commands as scripts in Backup Manager.

The scripts tab is only available when opening the backup manager locally on the device.

Adding scripts

Before you can add the script to run as part of the schedule, you must first create the script in the Backup Manager client.

  1. Launch the Backup Manager for the device
  2. Click Preferences > Scripts
  3. Click Add script

  4. Configure the settings:
    • Script name - Name the script something that will be recognizable when adding the script to the schedule, e.g. Backup Completed Notification
    • Username - The username for a user with sufficient permissions to run scripts on the local system
    • Password - The password for the username with sufficient permissions to run scripts on the local system
    • Timeout - enter a time limit (in seconds) after which the script will be stopped
    • Fail backup on error - Check this box to fail the backup, or stop the backup from running if the script returns an error

      If a pre-backup script is important, enabling the fail backup on error setting will stop the following backup from running

    • Script body - In the remaining text box, provide the script content
  5. (optional) Click Test to make sure the script has been entered correctly
  6. Click Save

Available settings for scripts

  • Scripts run under the LocalSystem account that Backup Manager normally operates under. If your script requires some special permissions, you should provide an alternative username and password. The account you specify must be from the administrative group. Different username formats are supported: username, username@domain and domain\username
  • The Group field on Linux and macOS devices requires the name of the group

Applying scripts

The scripts you have added become available for selection in the backup schedule settings (Preferences > Schedule). You can add a script to an existing backup schedule or create a new schedule for this purpose.

Once added to the schedule, these scripts run once per backup source. For example, where a schedule contains both Files & Folders and System State backup sources, a schedule’s pre-backup script runs before each backup takes place.

  1. Launch the Backup Manager for the device
  2. Click Preferences > Schedule
  3. Expand an existing schedule, or click Add Schedule to create a new one
  4. If adding a script to an existing schedule, select the script from the Pre-backup or Post-backup dropdown boxes. If creating a new schedule, follow these instructions to create a new schedule

  5. Click Save

Removing scripts

To remove a script that you no longer need, remove it from any schedules, then navigate to the Scripts tab and delete it using the cross icon next to its name.

Note for Linux users

The syntax for Linux machines is the same as for usual bash scripts. Here is an example:

#!/bin/sh
echo "Daily backup completed" >> /tmp/daily-backups.txt
exit 0

Save

You must make sure to save any changes you make before moving away from this page.