Pre and post commands

Discussion in 'Acronis True Image Product Line' started by jeffg53, Jun 24, 2006.

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

    jeffg53 Registered Member

    Joined:
    Jun 24, 2006
    Posts:
    13
    I am trying to schedule a job with pre and post commands but am having no luck getting the commands to work. I have tried both DOS commands and BAT files.

    Is there some magic thing that has been overlooked in the manual. It does seem rather short on examples.

    Cheers
     
  2. MKairys

    MKairys Registered Member

    Joined:
    Oct 13, 2005
    Posts:
    309
    Location:
    Ann Arbor, Michigan
    Pre/post commands have been broken in releases past; it is possible they could have been broken anew in 3666 (stranger things have happened - in 3666!)

    I would like to test this for you but I have just discovered that I can't edit tasks at all. What about you: are you able to edit tasks?

    If you provide some more detail about your commands and what is happening we might be able to suggest something...
     
  3. jeffg53

    jeffg53 Registered Member

    Joined:
    Jun 24, 2006
    Posts:
    13
    I can't edit tasks either. This happens when I create a command and then run the backup or use the test command button. I was trying DEL commands in either DOS or a BAT file. I entered something like DEL F:\data\weekly*.tib which I can run in a DOS box but not in TI
     
  4. MKairys

    MKairys Registered Member

    Joined:
    Oct 13, 2005
    Posts:
    309
    Location:
    Ann Arbor, Michigan
    shieber has pointed out that (only) file/folder tasks can be edited...

    I tested a simple example with a bat file containing only "dir > xxx.out" as a pre-command. I saw that xxx.out was indeed created, both wth "Test Command" and actually running the task.

    I noticed with Test Command that a dos window came up but did not display anything, e.g. when my bat file contained only "dir". Are you sure the command is actually failing?
     
  5. jeffg53

    jeffg53 Registered Member

    Joined:
    Jun 24, 2006
    Posts:
    13
    I tried this:

    Create a file called text.txt on my E drive
    Entered del e:\text.* on the command line and pressed test command
    Got User command's execution failed.
     
  6. MKairys

    MKairys Registered Member

    Joined:
    Oct 13, 2005
    Posts:
    309
    Location:
    Ann Arbor, Michigan
    The pre/post command processor is aware of the command's return status; however if the command failed you might not see the error message. Were there any such files?
     
  7. jeffg53

    jeffg53 Registered Member

    Joined:
    Jun 24, 2006
    Posts:
    13
    There was a file and it did not get deleted. Using the same command in a DOS box deleted it.
     
  8. GroverH

    GroverH Registered Member

    Joined:
    May 10, 2006
    Posts:
    2,405
    Location:
    Massachusetts, USA
    You might bootup using the Recover CD and verify that the drive letter you are using appears as the same letter in the Recovery display. Perhaps there is some drive letter confusion--just a thought.
     
  9. jeffg53

    jeffg53 Registered Member

    Joined:
    Jun 24, 2006
    Posts:
    13
    I just tried that and my E drive is still an E drive in the recovery environment.
     
  10. MKairys

    MKairys Registered Member

    Joined:
    Oct 13, 2005
    Posts:
    309
    Location:
    Ann Arbor, Michigan
    I've tested this feature quite a bit but I must admit I've never tried a "bare" command. Have you tried putting the delete command in a bat file? Have you tried other bat files?

    A quick test I've used: a bat file ending with "exit 0" should cause TI to say "succeeded", while "exit 1" should cause it to say "failed".
     
  11. shieber

    shieber Registered Member

    Joined:
    Oct 27, 2004
    Posts:
    3,710
    I found it best to run cmd.exe as the command and "/c [batchfile path and name]" as the parameter. Also it might help to uncheck the boxes in the Edit Command window.

    Good luck

     
  12. jeffg53

    jeffg53 Registered Member

    Joined:
    Jun 24, 2006
    Posts:
    13
    Thanks for the suggestions. I'm travelling at the moment and won't be able to try them for a day or two. I'll reply then with the results.

    I hope that someone from Acronis monitors this stuff. I could have been saved some pain if the manual had a simple example of how it was meant to work.
     
  13. shieber

    shieber Registered Member

    Joined:
    Oct 27, 2004
    Posts:
    3,710
    Also, you need to turn off the verify after backup option in the task if you want to run a post-command.
     
  14. Acronis Support

    Acronis Support Acronis Support Staff

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

    Thank you for choosing Acronis Disk Backup Software.

    Please accept our apologies for the delay with the response.

    Please note that the problem with the scheduled task editing is already known and fixed. The fix for this problem will be available in the next build of Acronis True Image we release. We plan to release it in the nearest future as soon as we finish testing it. Please accept our apologies for the current inconvenience.

    In the pre\post commands fields of the backup archive creation options you can specify commands or batch files to be automatically executed before and after the backup procedure. You can use any commands supported by Windows command line interface or enter a path to the batch file written in terms of standard Windows scripting rules (see this Microsoft Knowledge Base Article for details).

    Please also take a look at this previous post providing the example of a batch file automatically renaming backups in accordance with the current date.

    Thank you.
    --
    Tatyana Tsyngaeva
     
  15. jeffg53

    jeffg53 Registered Member

    Joined:
    Jun 24, 2006
    Posts:
    13
    Thanks for all the help. I've just had the Secure Zone pointed out to me. That does exactly what I want. I now have a weekly full with daily incrementals set up, so I don't need pre and post commands anymore.
     
  16. foghorne

    foghorne Registered Member

    Joined:
    Sep 27, 2005
    Posts:
    1,389
    Location:
    Leeds, Great Britain
    By the way, without trying to teach anyone to suck eggs, I find that a good way to verify that an automated batch file runs is to execute something like:

    dir > list.txt

    which produces a textfile of the current directory contents. Much better than deleting files I find.

    F
     
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.