This article describes the Script Validation component of advanced screenshot verification. This feature is only available on Datto appliances running Ubuntu 16.04.
Datto appliances leverage a new screenshot verification engine. This new architecture is faster, more accurate, and less resource-intensive than the first generation of screenshot verification. It also includes the ability to perform additional validations during the screenshot process to further help in verifying backup integrity.
Advanced Screenshot Verification introduces Script Validation, which allows the appliance to execute scripts upon screenshot verification. As an example, a SQL database could be checked to validate that a given table returns the correct number of rows, or an Exchange server could be checked to validate it can connect to Active Directory. Several example scripts are available for you to download from the Datto Downloads page; you can also develop your own scripts.
You can configure backup verification scripting by navigating to the Protect → Configure Agent Settings → Verification → Backup Verification section of the Datto appliance GUI. Use the Upload Scripts button to add the scripts to the protected agent's profile, as shown in Figure 1. Upload the scripts in the order in which they need to run. The scripts will run during the agent's scheduled screenshot verification window.
There are three script verification templates available for download at http://download.datto.com/#scripts, which you can use to create your own scripts. They are:
- Check Database: Validates that a designated table in a database returns a specified number of rows.
- Check Web App: Validates that a web application is running, and returns the app homepage.
- Check Service: Validates that a designated Windows service is available upon boot.
After the verification script runs, and the screenshot completes, the Datto appliance will display the results of the verification in the Manage Recovery Points page of the device GUI, in the Backup Verification column. You will receive a "Verification Script Succeeded" or a "Verification Script Failed" message. Clicking the View Results button will provide more detail about the outcome of the script test.
Q: At what point do the scripts run?
A: The scripts will run during the agent's scheduled screenshot verification window.
Q: Is Powershell the only scripting language that is supported?
Q: Can we trigger an email alert if the script returns a fail?
A: The Datto appliance considers a screenshot to have failed if one or more of its pass conditions does not succeed. If a script fails, but the screenshot boots successfully, the device will consider the verification to have failed. If you configured the appliance's alerts to notify you of screenshot failures, you will receive an email notification that the verification did not complete successfully.
Q: What script functions does the Datto appliance itself interpret?
A: The Datto appliance only interprets whether the exit code is 0 (success) or anything other than (failure).
- Microsoft TechNet: Windows PowerShell Scripting (external link)