46690: Acronis Software: Troubleshooting Pre/Post Commands Issues

    Follow these steps to troubleshoot Pre/Post backup commands:

    1. Get familiar with technology in the About part.
    2. Check for known issues in the Known issues part.
    3. Follow to Troubleshooting part to troubleshoot and resolve the issue.


    Pre-/Post-Backup or Pre/Post data capture commands can be used for various operations such as:

    • Stopping services of non-VSS-aware application before snapshot and starting them after backup;
    • Running troubleshooting scripts on automated basis if a problem is not stably reproduced.

    See more in following articles:
    Acronis Backup Web Help: Pre/Post commands
    Acronis Backup Web Help: Pre/Post data capture commands
    Acronis True Image 2016 Web Help: Pre/Post commands for backup

    Pre/Post commands are axecuted by Acronis agents both in local and centralized backup plans.

    Known Issues

    Title Status
    Acronis Backup: If multivolume snapshot is disabled or snapAPI fails to create a multivolume snapshot then Pre/Post data capture commands are carried out more than once.  Fixed in build 38350
    Acronis Backup: Unclear error is given if the script does not exist. Fixed in build 38350


    Follow step-by-step instructions below to troubleshoot the issue. Complete prerequisites step before proceeding to error troubleshooting step.

    1. Prerequisites

    Complete all steps before proceeding to error troubleshooting step.

    1.1 Correct syntax

    Make sure that your script exists and is working without Acronis.

    1.2 Correct backup plan settings

    1. In the Command field, type a command or browse to the batch file. The program does not support interactive commands, i.e. commands that require user input (for example, "pause") or starting executable files (for example, .exe-files).
    2. In the Working directory field, specify a path to a directory where the command/batch file will be executed. This is a directory context of the command. This is not the folder with the batch file. This is equivalent to issuing command "cd FOLDERNAME" before running actual script.
    3. In the Arguments field specify the command’s execution arguments, if required.

    If all steps above have been executed and issue still persists, go to error troubleshooting step.

    2. Error troubleshooting

    Complete all steps before proceeding to collect information step.

    2.1 Script is accessible

    Make sure the destination of your script is accessible by Acronis software:

    • When using Centralized management in Acronis Backup, place the script either on a share or on each agent. E.g. if you put "C:\somefile.bat" then each agent has to have "C:\somfile.bat".
    • If the script is on a network share make sure that the user that is running the backup plan has access to this share. Try to open the share in Windows Explorer providing credentials specified in the backup plan.

    2.2 Script is working

    Make sure your script actually succeeds.To succeed your script has to return “0”.

    To check the exit code you should:

    - In Windows: open Command Prompt (start -> run -> cmd). Execute your script in the CMD. Then issue command "echo %errorlevel%". This will output the exit code.
    If script succeeded, you will see:

    - In Linux: execute your script in the bash shell. Then issue command "echo $?". This will output the exit code.

    If your script does not return 0 but you want to force it you can use exit /B 0" in batch files in Windows and "exit 0" in bash in Linux.

    2.3 Debug file

    In case your script works without Acronis but fails when run by Acronis you should add some debug file outputs to make sure what is wrong. In batch files that is easily done by adding this line into your batch file: 

    echo "Debug Info" >> C:\temp\debuglog.txt

    Expected result of this debug procedure is to check whether the script is successfully executed until it reaches this command. In this case a file with "Debug Info" is created in C:\temp.debuglog.txt You can localize the faulty command by inserting this line after the part you want to check in your script or by giving it another parameters.

    What and where to put the debug outputs and the content of those outputs depends on the running script itself. Adjust this method depending on your script.

    If all steps above have been executed and the issue still persists, go to collect information step.

    3. Collect information

    Collect following information and contact Acronis Customer Central.

    3.1 Backup plan 

    Export of the backup plan. See: Acronis Backup: Import and Export of Backup Plans

    Or make screenshots of the backup settings.

    3.2 Script

    The script that you are trying to run as Pre/Post command.

    3.3 Process Monitor log

    Reproduce the problem and collect Process Monitor log on the Agent machine during script execution.

    3.4 Log

    Log of failing backup plan: right-click on the plan -> Log -> Save to file.

    If Centralized Backup plan is used System Report from Acronis Management Server is also required.

    3.5 System Report

    Collect System Report from the machine in question.

    See instruction for Acronis Backup 11.7/11.5 Generating System Report, if Centralized Backup plan is used System Report from Acronis Management Server is also required.
    For Acronis True Image 2016: Generating System Report
    If this fails for any reason, you can use this AcronisInfo Utility.