Batch File problem

Discussion in 'Acronis True Image Product Line' started by timmmmm, Apr 23, 2009.

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

    timmmmm Registered Member

    Joined:
    Apr 5, 2009
    Posts:
    4
    Howdy,

    I am trying to run a simple batch file before the full backup procedure that renames backups and deletes the oldest ones. It looks like this:


    cd /d x:\Timtest

    del old_2.tib
    if exist old_1.tib rename old_1.tib old_2.tib
    if exist timtest.tib rename timtest.tib old_1.tib



    The problem is that if I run the batch file manually - nothing to do with Acronis, it works perfectly, but when I run it in the "pre/post" options, either the backup fails, or it rewrites over the top of the timtest.tib backup. I have it working on another machine, and am trying to implement it on another and I'm at the point of tearing my hair out.

    When the backup fails, I get the following error message:

    Execution of user command Y:\Acronis.......rename_backup.bat failed. error code: 1

    Acronis TI echo workstation with Acronis Universal Restore. WindowsXP Pro SP3.

    Any help will be greatly appreciated.
     
    Last edited: Apr 23, 2009
  2. Acronis Support

    Acronis Support Acronis Support Staff

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

    Thank you for your interesting in Acronis True Image

    You can use the following batch file to achieve desired purposes. The batch file provided will allow you to set up a backup retention policy for the backup files saved to a folder on the local drive. Please rename the provided batch file to pre.bat and follow the instructions provided below to set it as a pre-backup command for your backup task.

    NOTE: There is no need to edit the batch file provided. The target location, amount of backups and amount of backup sets that you want to keep is specified by providing the corresponding parameters (see more details below).

    1. Schedule a daily, weekly or monthly backup task choosing a folder on a local drive as a target location for backup files. Make sure to select the "Create incremental backup if possible" or “Create differential backup archive” option depending on whether you want to create incremental or differential backups.

    2. Place the batch file provided into a folder on the local disk (any folder) and then set it as a pre-backup command in the Backup Creation Options specifying the following parameters in the 'Arguments' field dividing them by one space:

    NOTE: If the path to the batch file contains spaces (for example, C:\batch scripts\pre.bat) then, according to the common Windows Command Line scripting rules, you MUST take it into double quotes (for example, ”C:\batch scripts\pre.bat”). Otherwise, the batch file will NOT execute as a pre backup command.
    I. Path to the backup folder in the form of [drive letter]:\[folder name]. For example, E:\Backups
    NOTE: If the path to the target backup folder contains spaces (for example, E:\Acronis backups\) then, according to the common Windows Command Line scripting rules, you MUST take it into double quotes (for example, “E:\Acronis backups\”). Otherwise, the batch file will NOT be able to access the target backup folder.
    II. Total amount of backups in each backup set (full + a number of incremental backups). For example, if you create a daily backup task and want to keep a week worth of backups, set this value to 7.
    III. Amount of older backup sets you want to keep (there will always be the current backup set and X amount of older sets located in set1, set2, etc. subfolders within the parent backup folder). For example, if you set up a daily backup task and set the amount of backup in each set to 7 then specify 3, if you want to keep 4 weeks worth of backups (you will always have 1 current set and 3 older sets each consisting of ).

    Here is what this pre-backup command is going to do

    1. Once the amount of backups in the backup folder reaches the predefined limit, it will place the entire set of backups (set = full + a number of incremental or differential backups) to a subfolder named set1, set2, set3, etc.

    2. Once the amount of backup sets (set1, set2, set3, etc. subfolders) reaches the predefined limit, the oldest one (set1) will be deleted and the rest will be renamed in the following way set2->set1, set3->set2, etc.

    3. If you set up a daily backup task and specify 7 and 3 for the amount of the backups in the backup set and the amount of the older backup sets that you want to keep, you will always have no more than 7 backup files in your backup folder and no more than 3 older sets of backups consisting of 7 backup files each (4 sets total, i.e. the current one + 3 older sets).

    NOTE: Note you can specify any other values than 7 and 3. For example, if you only want to keep full and no incremental or differential backups you can set the amount of backups in each set to 1 so each set only consists of one full backup.

    Best regards,
    --
    Dmitry Nikolaev
     
  3. timmmmm

    timmmmm Registered Member

    Joined:
    Apr 5, 2009
    Posts:
    4
    Thanks Dmitry, but there is still a problem. When I set this backup task to run manually, the backup proceeds and completes perfectly. The backup always fails when I schedule the task for a later time. I get the following error in the log:

    <?xml version="1.0" encoding="UTF-8" ?>
    <log build="174" product="Acronis*True*Image*Echo Workstation" task="D21F3241-19B5-4382-B018-08B2C188AE1A" uuid="2CEB2D1F-C307-4F11-9F38-39A7BA62CD7F" version="1.0">
    <event code="2" id="1" level="2" message="The &quot;test&quot; operation started" module="100" time="1240914942" />
    <event code="11" id="2" level="3" message="Priority changed to Low priority" module="100" time="1240914942" />
    <event code="1015" id="3" level="4" message="Failed to run a child process." module="1" time="1240914942" />
    <event code="1025" id="4" level="4" message="System error: 267" module="1" time="1240914942" />
    <event code="133" id="5" level="4" message="Execution of user command O:\test\laptop\pre.bat failed. Error code: 1" module="100" time="1240914942" />
    <event code="5" id="6" level="4" message="Operation has completed with errors." module="100" time="1240914942" />
    </log>


    I get the error whenever the task is scheduled, no matter the destination of the backup (either network drive or local drive).

    please help, my client is ready to give up and I am trying to get him to persist.
     
  4. Acronis Support

    Acronis Support Acronis Support Staff

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

    Thank you for your interesting in Acronis True Image

    I have sent you scheduler update instructions via PM.

    Best regards,
    --
    Dmitry Nikolaev
     
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.