Scripts executed after a backup finishes

Accessing the script that runs after each backup
To access the After backup script shown above:
- Click
Jobs in the navigation bar
- Right-click on the desired job and select Edit.
- Click
Scripts on the left menu.
- Click
Run after each backup to expand the section.
Entering scripts that run after each backup
Scripts that run after a backup are useful if you need to restart certain applications that were temporarily disabled while the backup ran, or to move backup files to a different location on the network. These scripts will run regardless of whether the backup fails or succeeds.
- Input scripts to be run after each backup directly into the script window provided. Example below:
net start MSSQL
// This command will start the Microsoft SQL service.
- You can further customize your script by inserting unique variables:
- Click Insert variable.
- Choose a variable from the list.
- The variable will now be inserted into your script enclosed with percentage signs (eg. %JOB_NAME%).
- You can insert as many additional variables as required.
- An example with variables:
net send Administrator "Backup %JOB_NAME% completed - %STATUS% "
// This command will send a network broadcast to the Administrator user with the message (example):
"Backup SQL Data completed - successful "
- You can also determine how a failed script is flagged within the backup report using the drop-down menu to the right of the On script failure, report label:
- No error
If the script fails to execute the overall status of the backup job will not be affected.
- Minor warning
If the script fails to execute a minor warning will be logged and then displayed in the backup report.
- Major warning
If the script fails to execute a major warning will be logged and then displayed in the backup report.
- Error
If the script fails to execute an error will be logged and then displayed in the backup report. The job will also terminate at this point before completing any further processes.
