Skip to main content

Pre/Post commands for validation schedule

Thread needs solution

I have scheduled backups, where I use commands to turn on my external hard drive before starting the backup and then to turn it off after backup completion.
However, I have also scheduled weekly validations (Options->Advanced->Validation->Validate backup regularly).

In this case, the scheduled validation is not working because the external hard disk is turned off.
It would be important to have a pre/post command for validation only.

0 Users found this helpful

Pre/Post commands for validation tasks are not implemented by Acronis but there are several ways in which you could achieve what you are asking:

One way would be to modify the C:\Program Data\Acronis\TrueImageHome\Scripts file for the Validation task and add in the Pre command information but this assumes that the same script is reused each time that the scheduled validation is actioned.

You can identify the Script by using the MVP Log Viewer and finding the task that ran at the scheduled date/time and noting the script identifier in the log name.

2018-08-18 11_57_53 Validation log.png

In the associated script file, you would need to enter the Pre command details in the section as shown below (from a backup task using a pre command - for an example).

    <stage>
        <before>
            <user_command>
                <command enabled="false" hidden_flag="false" mode="backup" skip_result="false" terminal_flag="false" wait_for_end="true">E:/Stop_AAP_delete_tibs.bat</command>
                <work_directory>E:/</work_directory>
            </user_command>
        </before>

The main issue with this approach is simply that there is no guarantee that any changes wouldn't be lost if ATI 'touches' the script file etc.

An alternative approach that should work, would be to create a BAT file that turn on your external drive then launches the validation task from the same BAT file before then turning off the drive again.

To launch ATI to do the validation.

echo off
rem turn on external drive...
set ATI="C:\Program Files (x86)\Acronis\TrueImageHome\TrueImageLauncher.exe"
set task1=2BF45C62-B17B-4816-B470-9825BDCDC572
:validate
%ATI% /script:%task1%
rem turn off external drive...
exit

The validation task script ID needs to be set for the above batch script.

From the Community Tools link in my signature.

Just one more thing. In case of any validation error, does "TrueImageLauncher.exe" returns some errorlevel to BAT?

If you check the main ATI GUI you will see that the task is actually running there, so any errors would also show in the GUI or you can look at the validation log via the MVP Log Viewer tool.