Pre/Post Command Failure in ATI WS Echo (9.5.8076)

Discussion in 'Acronis True Image Product Line' started by CAOgdin, Mar 31, 2008.

Thread Status:
Not open for further replies.
  1. CAOgdin

    CAOgdin Registered Member

    Joined:
    Nov 1, 2004
    Posts:
    87
    There is a significant defect in the Post Command capability in ATIWE (all three builds, to-date, including Build 8076 from March 17, 200:cool:. The Pre- commands work fine, but the Post- commands fail.

    The specific script I'm running is enclosed. It has a lot of variables (so it's customizable to my customer's needs), and reports its' progress with echo Test here >>Logfile.log. Except, those commands will not work.

    We do it this way, because we believe that scripts should always do proper diagnosis, and report specific reasons for failure to the end-user. In this case, we write results and diagnostic information to the log file.

    The temporary workaround (until Acronis addresses the problem): Use a two-stage cmd file structure:

    CopyTrueImage.cmd:
    @echo off
    REM Version 2.0 March 31, 2008

    REM (C) 2007,2008 Carol Anne Ogdin (caogdin@gmail.com)
    REM To overcome a clear bug in ATI Echo Workstation (v9.5), which
    REM limits functionality of cmd file execution.

    REM Use this one to show the execution history in a log file
    REM cmd /x /c CopyTrueImage2.cmd >LaunchCopy.cmd.log
    REM ...OR...
    REM Use this one to run without capturing execution history
    cmd /x /c CopyTrueImage2.cmd


    CopyTrueImage2.cmd:
    @Echo off
    REM Version 2.0 March 31, 2008

    REM (C) 2007,2008 Carol Anne Ogdin (caogdin@gmail.com)

    REM ***Description***
    REM This script is invoked from Acronis Truelmage AFTER the image was created.
    REM It will copy the new archive from %FromTI% to the %ToTI% drive.
    REM If it is already occupied by a prior image, and there is a %Prior%
    REM folder, the prior image file(s) will be moved, replacing the even
    REM older image already there.
    REM The requirement is that when Acronis Truelmage job is created, the
    REM computer name must be the first characters of the file name.
    REM See the associated ScriptsReadMe.txt for more details

    REM ***Configuration section*** (Set up for your own environment)
    REM Local drive where local TrueImages were recently made
    set FromTI=X
    REM Name of Target computer's share where TrueImages will be copied (or blank)
    REM For example: \\Server\Share or \\Server\Share\Folder
    set ToShare=
    REM Specify target drive for the copy. %ToTI% must be a single letter, and
    REM may be blank (to kill this script)
    set ToTI=N
    REM Base names of the just-made TrueImage files
    set TIName=%computername%*.tib
    REM Synthesize a log name
    set AppendToLog="%~dpn0.log"
    REM Where Truelmage Prior copies are stored (subdirectory)
    set Prior=Archive

    REM Uncomment below to debug (will "echo" key commands, not execute)
    REM echo on & set debug=echo WILL

    REM Set Name of Computer in all uppercase
    set Name=MYCOMPUTER

    REM ***Script Starts Here***
    REM Confirm we're on the right computer (otherwise, report why it won't run)
    if not "%Name%" == "%computername%" goto Prohibit
    REM Assert: We're on the proper computer

    REM See if we're suppressing this script by not specifying a target drive
    if "%ToTI%" == "" goto Fini

    REM If there's no backup to copy, report it and quit
    if not exist "%FromTI%:\%TIName%" goto NoImage

    REM Report state of debugging
    if not "%debug%"=="" echo %DATE%@%TIME%: Debug is enabled. >>%AppendToLog%

    REM Are we Mapping to a Share, or using another drive?
    if "%ToShare%" == "" goto NoMapping
    REM Assert: %ToShare%<>"" and %ToTI% is a single letter
    if not exist "%ToShare%\" goto NoShare
    REM Assert: %ToShare% is valid
    REM Map drive letter (%ToTI%) to %ToShare% on the destination
    REM (Input from "yes" file required in case the mapped drive is open)
    if exist %ToTI%:\ net use %ToTI%: /DELETE <yes
    net use %ToTI%: "%ToShare%" >nul
    :NoMapping
    if not exist %ToTI%:\ goto NoDrive

    REM Decide which function to perform (nothing, archived or deleted)
    set Message=not found
    if not exist "%ToTI%:\%TIName%" goto DoCopy

    REM Assert: There is a prior image, where the new copy goes.
    if not exist "%ToTI%:\%Prior%" goto KillOld
    REM Assert: There IS a folder where the immediate prior copy goes
    set Message=archived
    REM Purge even older archive file(s), if one or more exist
    if exist "%ToTI%:\%Prior%\%TIName%" %debug% del /q "%ToTI%:\%Prior%\%TIName%"
    REM Move the previously-saved image to the %Archive% folder
    %debug% move "%ToTI%:\%TIName%" "%ToTI%:\%Prior%\"
    goto DoCopy

    :KillOld
    REM Assert: There is no %ToTI%:\%Archive% folder, so delete the prior image
    set Message=deleted
    %debug% del /q "%ToTI%:\%TIName%"

    :DoCopy
    REM Assert: There is (now) no old %TIName% file on %ToTI%
    %debug% xcopy /R /Y "%FromTI%:\%TIName%" %ToTI%:\
    if errorlevel 5 goto CopyError
    if errorlevel 4 goto InvalidError
    if errorlevel 2 goto UserStopped
    if errorlevel 1 goto CopyError
    goto Report

    REM Various messages and after-action activities
    :NotMapped
    if "%ToShare%" == "" goto NoDrive
    echo %DATE%@%TIME%: ERROR: The drive at %ToShare% could not be mapped to %ToTI%:. >>%AppendToLog%
    goto Fini

    :NoDrive
    echo %DATE%@%TIME%: WARN: Could not access drive %ToTI%:. >>%AppendToLog%
    goto Fini

    :NoShare
    echo %DATE%@%TIME%: ERROR: The share %ToShare% is incorrect, or offline. >>%AppendToLog%
    goto Fini

    :NoImage
    echo %DATE%@%TIME%: WARN: Nothing at %FromTI%:\%TIName% to be copied. >>%AppendToLog%
    goto Fini

    :UserStopped
    echo %DATE%@%TIME%: WARN: The user used Ctrl-C to stop the copy. >>%AppendToLog%
    goto CleanUp

    :InvalidError
    echo %DATE%@%TIME%: ERROR: There was a systax error or a missing file during copy to %ToTI%. >>%AppendToLog%
    goto CleanUp

    :CopyError
    echo %DATE%@%TIME%: ERROR: There was a fatal disk error during copy to the %ToTI%. >>%AppendToLog%
    goto CleanUp

    :Report
    set Dest=%ToTI
    if "%ToShare%" == "" set Dest=%ToTI%
    echo %DATE%@%TIME%: Copied %TIName% to %Dest%. A prior edition was %Message%. >>%AppendToLog%

    :CleanUp
    REM Free up the drive letter assigned before the copy
    if not "%ToShare%" == "" net use %ToTI%: /DELETE <yes >nul
    goto Fini

    :prohibit
    echo ERROR: This script may only execute on %Name%. >>%AppendToLog%

    :Fini
    exit 0


    A plea to Acronis: Please investigate and fix this bug. The cmd launch of the Pre- command works fine; the launch of the Post- command fails to produce output unless this workaround is employed.

    A plea to the reader: If you find a better way to solve this problem (or a bug in my CopyTrueImage2.cmd file, above, that causes the failure), please respond with your suggestions. Thanks for your help.
     
  2. CAOgdin

    CAOgdin Registered Member

    Joined:
    Nov 1, 2004
    Posts:
    87
    I just tested with ATI Home 11.0.8053 (same scripts, same tests) and discovered the same problem exists, and the workaround, above, works on ATIH11, too.
     
  3. Acronis Support

    Acronis Support Acronis Support Staff

    Joined:
    Apr 28, 2004
    Posts:
    25,885
    Hello CAOgdin,

    Thank you for choosing Acronis Software.

    We are sorry for delayed response.

    Could you please collect some additional information to let us investigate the problem thoroughly?

    Please create Windows System Information as it is described in Acronis Help Post from one of computers where the problem occurs.

    Please also clarify, does the command not run at all; or does it run, but not create logs?

    Then submit a request for technical support. Attach all collected files and information to your request along with the step-by-step description of the actions taken before the problem appears and the link to this thread. We will investigate the problem and try to provide you with a solution.

    Thank you.
    --
    Marat Setdikov
     
  4. CAOgdin

    CAOgdin Registered Member

    Joined:
    Nov 1, 2004
    Posts:
    87
    1. I've given you plenty of information in my examples for your programmers to demonstrate for themselves it works as I've described.

    2. Since Pre-Commands work fine, but Post-Commands do not, I'd invite your programmers to look at how they do one (Pre-, that works) and how its' different from the other (Post-, that doesn't)

    3. It appears (but I have not formally tested) that the scripts exits the ATI-produced Post-command environment after fully executing the xcopy command; since all log production is after that, the log never gets produced.

    4. After buying and installing more than 100 copies of ATI for various clients, I am constantly amazed to see that Acronis apparently believes that I have nothing more important to do for hours each day than to setup test conditions so as to do Acronis' debugging job for them. If you'd like to pay me to do the work, I can quote you my hourly rate.
     
  5. Acronis Support

    Acronis Support Acronis Support Staff

    Joined:
    Apr 28, 2004
    Posts:
    25,885
    Hello CAOgdin,

    We are sorry for delayed response.

    We have forwarded your information to our Experts Team for investigation.

    Thank you.
    --
    Marat Setdikov
     
  6. Acronis Support

    Acronis Support Acronis Support Staff

    Joined:
    Apr 28, 2004
    Posts:
    25,885
    Hello CAOgdin,

    Could you please clarify, do you have "Do not perform operations until the commands execution is complete" option checked for Post commands? It's unchecked by default.

    Thank you.
    --
    Marat Setdikov
     
  7. CAOgdin

    CAOgdin Registered Member

    Joined:
    Nov 1, 2004
    Posts:
    87
    No, I NEVER enable "Do not perform operations..." on Post commands (but I do on Pre commands).

    That default is fine, and changing it seems pointless because, at that point, the image has already been made. As you can see from the script, the Post command just copies the already-made image to another place, and if that fails, it reports to a log file for me to examine. I certainly would NOT want ATI to stall AFTER the image has been made, even if it can't perform the Post-image task.
     
  8. Acronis Support

    Acronis Support Acronis Support Staff

    Joined:
    Apr 28, 2004
    Posts:
    25,885
    Hello CAOgdin,

    We are sorry for delayed response.

    Could you please try turning that option on anyway? Our experts say it should resolve the problem.

    Thank you.
    --
    Marat Setdikov
     
  9. CAOgdin

    CAOgdin Registered Member

    Joined:
    Nov 1, 2004
    Posts:
    87
    Is this a proposed workaround, or is it a test you're asking me to conduct?

    What's the inherent value of enabling that option, when my documented workaround clearly does the job?

    I'm not trying to be difficult, but you're asking me to do your debugging job, for free, and I'd like some justification for why I should go spend an hour or so performing that test...or are you offering to compensate me for that time?
     
  10. CAOgdin

    CAOgdin Registered Member

    Joined:
    Nov 1, 2004
    Posts:
    87
    Okay, I ran the tests overnight. Here's what I found:

    Test 1:
    Configuration:
    1. Set Post-Command (under Tools | Options) to run, directly, CopyTrueImage2.cmd (bypassing CopyTrueImage.cmd, which invokes CopyTrueImage2.cmd).
    2. Checked (ON) the "Default..." and "Abort..." options in the Post-Command options.
    3. Tested eMail Notification (received notice from test).
    4. Ran normal full backup with ATI Echo 9.5
    Results:
    1. The CopyTrueImage2.cmd batch file ran properly.
    2. No Notification eMail message received.

    Then, I deleted the backups from both the X: and N: drives (back to same ab initio condition.

    Test 2:
    Configuration:
    1. Set Post-Command (under Tools | Options) to run, directly, CopyTrueImage2.cmd (bypassing CopyTrueImage.cmd, which invokes CopyTrueImage2.cmd).
    2. Unchecked (OFF) the "Default..." and "Abort..." options in the Post-Command options.
    3. Tested eMail Notification (received notice from test).
    4. Ran normal full backup with ATI Echo 9.5
    Results:
    1. The CopyTrueImage2.cmd batch file was invoked, but DID NOT PERFORM it's work.
    2. No Notification eMail message received.

    Let me know how this information helps you solve these bugs in ATI Echo Workstation 9.5.8076, and whether there will be fixes in a future update to this product. We still have two bugs, as evidenced by this test:

    1. The "Default" and "Auto" options MUST be set in the Post-Command options, and
    2. No eMail Notification is delivered from the product, even though tests work find when the "Test email" button is pressed after configuring that notification.
     
  11. Acronis Support

    Acronis Support Acronis Support Staff

    Joined:
    Apr 28, 2004
    Posts:
    25,885
    Hello CAOgdin,

    We are sorry for delayed response.

    Please notice that the option "Do not perform operations until the command's execution is complete" is unchecked by default for post commands, because in most cases it's used for either short start (for example, starting services that were stopped with pre command), or single step (a copy operation) processes, for which the default time allocated by system is enough. For complex scripts, however, as you found out, it's necessary to turn that option on to make Acronis True Image reserve for the script as much time as it needs to fully finish, no matter how long.

    Regarding e-mail notifications: please enclose the e-mail address in "<" and ">" brackets (like this: "<my@mail.com>"). Please make sure that SMTP server doesn't require encryption (such as SSL), as Acronis True Image doesn't support that. Please also leave Username and Password fields blank, unless the SMTP server requires authentication to send messages.

    Thank you.
    --
    Marat Setdikov
     
  12. CAOgdin

    CAOgdin Registered Member

    Joined:
    Nov 1, 2004
    Posts:
    87
    So, if you look at my script, you can see that once it's launched, it is utterly independent of ATI still running. If "Do not perform operations until the command's execution is complete" is unchecked, why should the ATI "Post-command" launch not run the command at all?

    If you replace my script with a simple "Echo I got started >file.txt", that command never gets executed. The *.cmd file it's in apparently never gains control.

    It seems to me that if the field is UNchecked, ATI should launch the "cmd" processor as a separate and independent task, so it can continue on even after ATI has shut down. If the field is CHECKED, ATI should launch the "cmd" processor as a dependent task, and await its conclusion and return before continuing in it's shut down sequence.

    Doesn't this make more sense?
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.