TI9 2287: before/after commands are broken worse than in 2277

Discussion in 'Acronis True Image Product Line' started by MKairys, Oct 13, 2005.

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

    MKairys Registered Member

    Joined:
    Oct 13, 2005
    Posts:
    309
    Location:
    Ann Arbor, Michigan
    How to write before/after backup commandso_O

    TrueImage "consumer" version, build 2277...

    I cannot by experimentation figure out the syntax expected by the before/after backup commands. For example:

    I want to run a Perl script before my TrueImage operation. Let's say the script is called "myscript.pl" and takes parameters "a" and "b".

    Now, perl.exe is on my path and .pl is registered as a command extension, so to run this script from a command prompt I need only say:

    myscript a b

    As a pre-operation command, this fails. Every variant I can think of also fails:

    perl myscript.pl a b
    c:\perl\bin\perl.exe myscript.pl a b
    c:\perl\bin\perl.exe c:\perl\bin\myscript.pl a b

    perl "myscript.pl a b"
    "perl myscript.pl a b"
    c:\perl\bin\perl.exe "myscript.pl a b"
    "c:\perl\bin\perl.exe myscript.pl a b"
    "c:\perl\bin\perl.exe "myscript.pl a b""

    etc, etc, etc.

    So I began trying even simpler things until I finally got something to work:

    c:\windows\system32\taskmgr.exe

    ...actually ran the task manager! However, TI said the command had failed and did not continue with my backup. The log says:

    <event code="132" id="9"
    message="Starting user command: c:\windows\system32\taskmgr.exe"
    module="100" time="1129220639" type="2" />

    <event code="133" id="10"
    message="Execution of user command c:\windows\system32\taskmgr.exe failed. Error code: 1"
    module="100" time="1129220656" type="4" />

    <event code="5" id="11"
    message="Operation has completed with errors."
    module="100" time="1129220656" type="4" />

    So: what is the correct syntax for these commands? How are arguments passed to them? What sort of programs may be used?

    And above all, how about a few examples in the documentation?!
     
  2. MKairys

    MKairys Registered Member

    Joined:
    Oct 13, 2005
    Posts:
    309
    Location:
    Ann Arbor, Michigan
    TrueImage "consumer" version, build 2289...

    Before/after commands are broken more badly in 2289 than 2277.

    Summary:

    (1) If the batch file or program designated in a command is not found, TI will report the command succeeded.

    (2) If an attempt is made to pass an argument to the batch file or program in a command, the command will fail to run, but TI will report the command succeeded. (In 2277 it reported that the command failed.)

    Details:

    Test setup: scheduled task, backup of files and folders, full backup.
    Before backup command to run a batch file or program.

    Batch file c:\local\bin\test.bat:

    echo This is test.bat, arg is '%1'
    pause
    exit 0

    Program c:\local\bintest.exe, compiled from test.c:

    #include <windows.h>
    main( int argc, char* argv[] )
    {
    char msg[64];

    if ( argc > 1 )
    sprintf( msg, "Arg is '%s'", argv[1] );
    else
    sprintf( msg, "No arg" );

    MessageBox( 0, msg, "Test", MB_OK );
    exit(0);
    }

    In order to test the effect of an error return from the batch file or program,
    "exit 0" was changed to "exit 3" and "exit(0) to "exit(3)".

    Results were similar for batch file and program.

    Test 1: No arg, no error return: command is run, TI reports command succeeded.

    <log build="2289" product="AcronisÂ*TrueÂ*Image" uuid="6257480F-A6FB-4ED9-8361-06D956FE5CCE" version="9.0">
    <event code="2" id="1" message="The &quot;Test&quot; operation started" module="100" time="1129380161" type="2" />
    <event code="11" id="2" message="Priority changed to Low priority" module="100" time="1129380161" type="3" />
    <event code="134" id="3" message="Execution of user command succeeded: C:\local\bin\test.bat" module="100" time="1129380177" type="2" />

    Test 2: No arg, error return: command is run, TI reports command failed and correctly reports error code.

    <log build="2289" product="AcronisÂ*TrueÂ*Image" uuid="6DC5F1EB-ADF5-445F-8B73-13F8BAC724E5" version="9.0">
    <event code="2" id="1" message="The &quot;Test&quot; operation started" module="100" time="1129380536" type="2" />
    <event code="11" id="2" message="Priority changed to Low priority" module="100" time="1129380536" type="3" />
    <event code="133" id="3" message="Execution of user command C:\local\bin\test.bat failed. Error code: 3" module="100" time="1129380540" type="4" />
    <event code="5" id="4" message="Operation has completed with errors." module="100" time="1129380540" type="4" />

    Test 3: incorrect path (c:\local\test.bat): command is not run, TI reports command succeeded.

    <log build="2289" product="AcronisÂ*TrueÂ*Image" uuid="82CDFE96-5E0D-42FE-A5ED-505592A5BBAA" version="9.0">
    <event code="2" id="1" message="The &quot;Test&quot; operation started" module="100" time="1129379930" type="2" />
    <event code="11" id="2" message="Priority changed to Low priority" module="100" time="1129379930" type="3" />
    <event code="134" id="3" message="Execution of user command succeeded: c:\local\test.bat" module="100" time="1129379930" type="2" />

    Test 4: correct path, attempt to pass argument: command is not run, TI reports command succeeded.

    <log build="2289" product="AcronisÂ*TrueÂ*Image" uuid="BC3ADA2B-2CA8-43DA-BA64-E88FEC975A5C" version="9.0">
    <event code="2" id="1" message="The &quot;Test&quot; operation started" module="100" time="1129380293" type="2" />
    <event code="11" id="2" message="Priority changed to Low priority" module="100" time="1129380293" type="3" />
    <event code="134" id="3" message="Execution of user command succeeded: C:\local\bin\test.bat hello" module="100" time="1129380294" type="2" />

    Note: as I have noted elsewhere, I have no information about passing arguments and what syntax
    (if any) might allow this. I have tried every combination of quotation I could think of.

    Final note: I observed at the conclusion of these tests that the TI icon in the taskbar notification area
    remained after I had exited TI. This has not happened otherwise and thus maybe related to the use of commands.
     
    Last edited: Oct 17, 2005
  3. Acronis Support

    Acronis Support Acronis Support Staff

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

    Thank you for choosing Acronis Disk Backup Software.

    Please accept our apologies for your inconvenience.

    This problem is known and will be fixed in future.

    Thank you.
    --
    Irina Shirokova
     
  4. MKairys

    MKairys Registered Member

    Joined:
    Oct 13, 2005
    Posts:
    309
    Location:
    Ann Arbor, Michigan
    Thanks for your reply... I assume of course that you are referring to this problem...
     
  5. Shraddhan

    Shraddhan Registered Member

    Joined:
    Nov 19, 2005
    Posts:
    26
    In build 2302, the BEFORE and AFTER commands do work now.

    HOWEVER, the before command is executed AFTER TI9 has checked all disk drives / partitions.

    I would like to be able to use the before command to run a little program to check that the external USB drive on which the backup is to be stored is plugged in, switched on, and woken up.

    But because the so-called BEFORE command works too late, TI9 crashes when my USB drive is switched off, or has fallen asleep.

    The latest response that I received about this is that having the before command run sooner is a "feature" that is of low priority.

    Yeah, thanks...

    Shraddhan

    Oh, just remembered - can't use an AFTER command if you also want to verify the backup. Too bad...
     
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.