Running TI tasks from batch files

Discussion in 'Acronis True Image Product Line' started by MKairys, Nov 16, 2005.

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

    MKairys Registered Member

    Joined:
    Oct 13, 2005
    Posts:
    309
    Location:
    Ann Arbor, Michigan
    In this thread Ilya Toytman gives some advice about running TI tasks from the command line. Well, it turns out to be even easier than indicated; I'm using this technique in my backup system, with TI 9. For me it has several advantages:
    • Avoids using the (currently broken) pre/post command feature
    • Allows me to use the Windows task scheduler
    • Allows me to embed TI tasks in my own scripts, however complex :)
    I like using the Windows task scheduler here even though the Acronis scheduler is more capable. I have several other WTS tasks, and this way I have all my "scheduled things" in one place.

    It turns out that:
    • The TI installation creates a file association for ".tis" that runsTrueImageService.exe and gives it the .tis script file.
    • The .tis script file can be in any directory and renamed to anything.
    • The .tis files are XML, so you can read end edit them (Bless you, Acronis!)

    So the procedure I followed is:
    1. Create a Scheduled Task
    2. Find the .tis file (for TI 9, it's in %ALLUSERSPROFILE%\Application Data\Acronis\TrueImage\Scripts)
    3. Copy it somewhere and give it a readable name, e.g. SystemImageIncremental.tis
    4. Invoke it as a command from a batch or script file.
      • For a batch file (.bat) just invoke the .tis file as a command
      • In Perl (or C for that matter) invoke the .tis file with the system function. (In Perl use backquotes to catch any printout.)
    So I now run a Perl script via the Windows task scheduler that does all my backup management jobs, such as:
    • Collect stuff from various places before the backup
    • Rename an image file after the backup so it doesn't get overwritten next time
    • Manage the number of incremental backups I keep
    (Further details on request)

    TIP: the Acronis log files are XML too...
     
  2. Acronis Support

    Acronis Support Acronis Support Staff

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

    Thank you for choosing Acronis Disk Backup Software.

    Sharing your experience is very much appreciated.

    If you have any further experience to share, please feel free to post it on this forum.

    Thank you.
    --
    Alexey Popov
     
  3. seltzerman

    seltzerman Registered Member

    Joined:
    Oct 9, 2005
    Posts:
    5
    I was having problems with the Acronis Scheduler so I tried using the WTS as outlined in this thread. I was able to do it only by scheduling a shortcut to the .tis file into WTS rather than scheduling the .tis file itself. I Don't know why scheduling the .tis file does not work. Manually double clicking on the .tis file successfully launched the task from outside of WTS. When I dragged the .tis file into the scheduler, and the time came to run, it would change its "last run time" to the appropriate time, as if it had run, but absolutely nothing would happen. No error message, just business as usual. But if I created a shortcut to the .tis file first, then dragged the shortcut file into the WTS and scheduled it, it worked like a charm.

    BTW, the problem I was having with the TI scheduler was simply that my backups would all run when my computer came out of hibernation, even though I had unchecked the box in "Parameters" which would cause it to to execute at startup if the system was off at time of the original schedule. I consider Hibernation to be "off", but apparently Acronis does not.

    Using 9.0 Build 2323, Windows Tablet PC
    Craig
     
  4. MKairys

    MKairys Registered Member

    Joined:
    Oct 13, 2005
    Posts:
    309
    Location:
    Ann Arbor, Michigan
    Yes, I wouldn't expect the Task Scheduler to understand ".tis", except perhaps if it were added to %PATHEXT%. I found that cmd.exe would, but it seems to go through ShellExecute or some similar API that follows the Registry association.

    So you could either schedule a batch file that invokes the .tis file, or schedule the command pointed to by the Registry association, e.g. "C:\Program Files\Common Files\Acronis\TrueImage\TrueImageService.exe" /script:"%1"
     
  5. Acronis Support

    Acronis Support Acronis Support Staff

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

    Thank you for choosing Acronis Disk Backup Software.

    Could you please collect the following information?

    - Create Acronis Report and Windows System Information as it is described in Acronis Help Post;

    - Describe actions taken before the problem appears step-by-step.

    Please also do the following:

    - Download schedmgr.exe application;

    - Open the command prompt (Start -> Run -> cmd);

    - Run the following command in the folder the schedmgr.exe file was saved to:

    schedmgr get report > schedreport.txt

    - Collect schedreport.txt;

    Please submit a request for technical support with the subject indicating that you want to contact Alexey Popov. Attach all the collected files and information to your request along with the exact vendor and model of your Tablet PC and the link to this thread. I'll forward this information to our Testing Team and they will certainly do their best in order to find out the reason for this problem.

    Thank you.
    --
    Alexey Popov
     
Thread Status:
Not open for further replies.