Howto do backup generations (GFS-Grandfather,Father,Son) with Acronis TI. (chain2gen)
Acronis TI does a superior job in creating and maintaining a current backup.
However Acronis TI does not easily support creating and maintaining backup “generations”.
I opened a support request with Acronis to discuss the issues.
I had both email and phone dialogs with two Acronis tech support reps.
The end result of those dialogs was when it comes to backup generations
“Acronis Backup and Recovery 10 Workstation "
is a better solution than
“Acronis True Image”
The above does not mean that one can not use Acronis TI,
all it means is one needs to do something outside of Acronis TI GUI panels to achieve the desired (generation) result.
I have written an application called “Chain2Gen” which is responsible for maintaining
how many generations one retains as well as when a new generation is created.
This solution relies on Acronis TI inherit default ability to create and maintain a current backup - the very thing which Acronis TI excels.
The purpose of this forum post is to share application with you.
There is a lot of power and flexibility in using chain2gen and doing backup generations.
A zip file of chain2gen is attached to this post.
From Acronis TI’s perspective it neither knows nor cares about these generations.
All it knows is that prior to running a backup it calls our application.
After our application returns control Acronis does an “INCR” backup.
Acronis TI will now try to do an “INCR” backup.
If the target folder is empty/Devoid of “.tib” files
then Acronis TI default behavior is to start a new chain which means creating a new FULL in the target folder.
Starting a new chain also means resetting the incr file numbers for that chain back to 1 (the “full” backup
is file “1”. the first incr file will be numbered “2”).
Assume you had an existing Acronis TI backup INCR chain.
If you were to MANUALLY move all the “.tib” files from the target folder to a new folder.
You have effectively made that set of files (chain) a backup generation.
The next time Acronis TI runs it will start a new chain.
Chain2Gen via script Acronis_PreProcessing_task.bat automates the above process.
This application will perform the above tasks whenever it sees a file called “trigger.txt” in the target (storage) folder.
This file is created whenever any of trigger conditions which you define are met.
Trigger Conditions which can cause a new chain to start are:
1) Start a new chain when there are “xx” tib files in the target folder.
2) Start a new chain on specific calendar dates (such as the 1st and 15th)
3) Start a new chain on specific days of the week such as Wednesday and Sunday
4) Start a new chain on specific days of every other week such as every other Wednesday and Sunday
5) Start a chain on the “x” occurrence of a day within a month such as the 2nd Sunday of each month.
6) Start a new chain when the total megabyte (MB) usage of INCR files (not full) exceed a threshold you define.
7) Start a new chain manually by creating a file called “trigger.txt”.
If the above sounds useful to you, then your welcome to download the attached zip file.
If your worried about viruses you may review the code yourself prior to running
as 100% of the code is dos batch scripts which can be viewed with notepad.
Chain2Gen can be used for many things GFS backups, rotating backups for offsite storage and more.
I HIGHLY encourage you to read the documentation file "!readme_chain2gen.pdf".
I would like to thank GroverH for his many hours of testing my code and for providing Documentation.
2009-11-26 new zip file for version 2.1 of "chain2gen" http://forum.acronis.com/forum/5940#comment-11705
2009-12-14 new zip file for version 2.2 of "chain2gen" http://forum.acronis.com/forum/5940#comment-13500
2010-01-04 new zip file for version 2.3 of "chain2gen" http://forum.acronis.com/forum/5940#comment-15756
2010-01-19 new zip file for version 2.5 of "chain2gen" http://forum.acronis.com/forum/5940#comment-17360
2010-02-06 new zip file for version 2.6 of "chain2gen"
2010-02-23 new zip file for version 2.6.1 of "chain2gen" it so happens that v2.6 is missing a file called !_FORCE_NEW_CHAIN.bat v2.6.1 includes this missing file.
2010-05-11 new zip file for version 2.6.2 corrected typo near line 83 of script Populate_Date_Variables.bat (should read Tue not Tues)
Use the scheduling flexibility built into the Acronis Task Scheduler to control the frequency as to when a backup is to occur. Then utilize Chain2Gen to assist you in making sure that you get the a new full backup based on one or more of the 7 trigger conditions set by you.
Testing and working with the Chain2Gen program was a pleasure. It is real easy to implement. I would encourage others to try it and I believe you too will find it very useful. Thanks to oracledba for the extensive time he has spent developing this useful tool for our use.
Note the contents of the File_Inventory.pdf file. Several nice utilities included which are there as a courtesy from OracleDBA.
edited Nov.16 in blue
One cannot help but wonder why functrional equivalent the straightforward coding involved in batch files cannot be composed by Acronis programmers and incorporated into ATI. Acronis did achieve a step in this direction when it created automated file handling (of a sort) back around version 9 or 10. That seems like so long ago.
If the Acronis schedule is set for daily but the individual set params to less frequent than daily (or other odd parameters), does Chain2Gen send a stop command to Acronis when the unwanted daily job starts?
The premise/wording of your question is not correct.
All backups are "desired" backups.
The interaction, relationship and responsibilities between Acronis and Chian2Gen are pretty easy.
The primary Acronis's responsibility is run the Acronis backup schedule.
In otherwords - start a backup on whatever schedule the user has set.
Typically the user will demand a daily backup but the user's schedule could be any schedule they can conceive including no schedule at all.
In which case there are no "automatic" backups and all backups will be manually started by the user.
Chain2gen is a PRETASK, this means during the time Chain2gen is running is called Acronis does NOT yet know if that backup it is about to make will will be a "full" or an "incr".
Acronis can only make this assessment at the actual start of the backup and that start will not begin UNTIL chain2gen has returned control to Acronis.
if presented with an empty target folder Acronis has no choice but to make a full backup. the converse is true for incr.
Chain2Gen has two responsibilities.
1) Set conditions such that Acronis is "forced" to make the type of backup required.
The choices are "full" or "incr".
Chain2gen forces this upon Acronis by making folder set0 empty/devoid of *.tib files when a "full" is required
and letting the set0 folder continue to retain its *.tib files when a "incr" is to be made.
Chain2gen was designed to be run as a preprocessing task to an Acronis backup.
The very fact that chain2gen is running means that within a micro seconds of it finishing a Backup is about to begin.
The primary task upon Chain2gen is set conditions to force Acronis into making the type of backup required.
2) When chain2gen determines a new generation is required (i.e a trigger.txt file exists)
the chain2gen must promote the set0 chain into history following the rules for history retention.
As for Acronis main responsibility
This is completely controlled by the user selecting whatever options are desired within the Acronis job scheduling panel.
Right click a task and choose "change schedule" everything you see here are the options available to you to force Acronis into starting a backup when you need one taken.
As for Chain2Gen
Its first responsibility is completely controlled by setting any combination
of the 22 optional params (or user manually creating a trigger.txt file)
These 22 optional params are divided into 6 categories:
tib count -> TRGR_ON_MAX_TIB_CNT
cal day number -> TRGR_ON_DD[1-5]
day of week -> TRGR_ON_DAY[1-5]
day of every other week -> TRGR_ON_EVO_DAY[1-5]
month day occurrence -> TRGR_ON_OCRDAY[1-5]
incr MB size -> TRGR_ON_TOTAL_SUM_INCR_MB
If ANY of the 22 params are true then a "trigger.txt" file is created.
If a trigger.txt file is present then chain2gen "knows" that the backup which is about begin needs to be a "FULL".
For a "FULL" backup to occur chain2gen needs to clear the set0 folder by promoting it into history.
For a "INCR" backup to occur chian2gen doesn't need to do anything just exit and let acronis make its incr backup.
As for Chain2Gen's second responsibility (number of generations beyond current set to maintain)
This is controlled by the mandatory param "MAX_BACKUP_GENERATIONS"
Chain2Gen does not initiate a backup nor does it prevent a backup from happening. The initiation of backups is under the control of the user.
The scheduling flexibility built into the Acronis Task Scheduler enables the user to control the frequency as to when a backup is to occur. Once the backup is initiated, Chain2Gen can be used to assist in making sure that the prior backups are properly archived, and, if specified via the trigger conditions, forces the impending backup to be a full backup rather than an incremental based on one or more of the 7 trigger conditions set by the user.
The initial Backup can be scheduled via the Acronis Task Scheduler or manually started via the Acronis Task menu (GUI). After the first backup has been created via either of these two methods, then backups can additionally be initiated via desktop shortcuts or Windows Scheduled Tasks. Thus, Chain2Gen does not control when a backup occurs but does determine its disposition just seconds prior to the creation of each backup.
I had this response prepared so I went ahead and posted it even though it has some duplication of response.
Your signature encourages me to use both DrvNotify and Chain2Gen. Isn't this a contradiction? How can you run both as a pretask at the same time?
Nearly four years after being written, this program written by OracleDBA continues to be effective and usable on both 2009, 2010, 2011, 2012, 2013 and 2014. Most all of these features continue to be unique with C2G.
As a courtsey, Chain2gen includes a script file called
This bat file is pre-written to call both drvnotify and chain2gen.
This is a user controlled script that you may alter at will to fit your needs.
Its provided as an example of how to integrate "n" different pre-tasks with acronis.
It is not a contradiction. You can run both.
The Chain2Gen zip file includes a File-Inventory.pdf which has a brief discussion of all the files included in the zip file. One of those files listed is file 3. My_acronis_pretask.bat
Below are some extracts from the beginnning of that file. This file can be used to run both DrvNotify followed by Chain2Gen which will exit to allow TrueImage Home to complete your backup needs.
My_Acronis_pretask.bat wrote::: This file IS a user controlled script. You ARE welcome to edit this file
:: to suite your needs. This file comes pre-configured for integrating
:: "Chain2Gen" with "DrvNotify".
:: You will ONLY need to use this "my_acronis_pretask" script if have multiple tasks
:: to perform before an acronis backup. An example is prior to using Chain2Gen
:: you already had a Acronis pre-processing task backup.
:: In this event you will want to change your jobs to use this script and have this script perform
:: your original preprocessing task and then call our bat file "Acronis_PreProcessing_task"
:: If "DrvNotify" does not apply to you remove it and insert the code that does apply.
As you can see from the program comments, "My_acronis_pretask.bat" has capability to run other programs prior to starting TrueImage.
An example of another use would be to run Karen's Replicator instead of Drive Notify.
To do so:
Remove all of the code related to Drive Notify, starting with one line below line37 "Step 1 of 2 "Drive Notify"
and delete lines 37-63 until you reach one line above "Step 2 of 2 "chain2gen..""
:: Step 1 of 2 "drive notify"
::Start removal here
All lines between the two steps can be deleted.
:: Stop deletion here
:: Step 2 of 2 "chain2gen - acronis date and chain processing
An example of a replacement code which would run Karen's Replicator would be
:: Step 1 of 2 "Run Karen's Replicator"
"C:\Program Files\Karen's Power Tools\Replicator\PTReplicator.exe" "Copy Captures to SATA to V"
:: Step 2 of 2 "chain2gen - acronis date and chain processing
After you have made the modifications, save the "my_acronis_pretask.bat" under a new name such as "Rev1_my_acronis_pretask.bat"
Thus you can have several versions of "my_acronis_pretask.bat" under different names and each one can run a different task prior to the Chain2Gen exiting so the Acronis backup can run. Just be sure and put the proper revised name ("Rev1_my_acronis_pretask.bat") in the Acronis Task Preprocesssing window.
Chain2Gen is useful in so many ways. It has options for e-mail notifications and a user controlled countdown to Computer Shutdown, etc. Take the time to read the file overview in the "File_Inventory" pdf.
Chain2Gen is easy to configure. All the basic program (Acronis_PreProcessing_task.bat) needs is the user to configure "!_USER_SPECIFIED_PARAMS_FOR_ACRONIS.bat" which is easy to do. Simply supply the two required variables which are
....1. Disk letter such as X:
....2. Path/name of intended backup storage folder such as \ATI-Backups\
....3. Optionally assign some type of variable to control how many or when a new full backup is to occur.
Note: If you use Chain2Gen for multiple tasks, you will need to have multiple sets of files in different folders to handle the difference in file storage locations or target variables.
First post of this topic now contains zip file for chain2gen Version 2.1
The behavior of Chain2Gen in v2.1 has been changed/enhanced.
The FIRST backup taken for any given day WILL honor your day/date variables.
All subsequent backups for that set0 folder will ignore the DATE/DATE variables.
This means additional backups taken that same day will be INCR backups NOT new chains.
Of course if you have manually requested a new chain then you will get your new chain (full).
All other params such as TIB count and INCR MB size are still in play and may cause new chains to occur.
Assume your parameters are such that a new generation is made every Sunday.
If today is Sunday then the FIRST backup to occur today will honor your day/date parameters.
In this example your parameters will cause a trigger.txt file to be created which then causes a new chain (full) to occur.
If you happen to run an additional backups this same Sunday the additional backups will NOT be a new chain(full)
but rather these addtion backups will be INCRs onto the existing chain.
Next Sunday of course is different a different day/date and on that Sunday the FIRST backup to occur on that
day will honor your day/date parameters.
Use Chain2Gen for Full Backups plus Archive Splitting
While Chain2Gen works best with NTFS file systems, those with FAT32 file systems can still utilize many of its program features. The example below is for a user that is performing full backups only but using "archive splitting" to control size of backup files.
The "set MAX_BACKUP_GENERATIONS=6" user option indicates user wants 6 (can be more or less) sets(generations) of backup files saved. Each set will be in its own folder (set0, set1, set2, etc). Each set will comprise whatever split files are created when doing a "full" type backup. Backup file size will be as dictated by the "archive splitting" option set by the user.
The "set TRGR_ON_MAX_TIB_CNT=1" user option indicates that Chain2Gen is to check the number of backup files equals 1 or more, and if yes, Chain2Gen is to move the backup files into the next successive "set" folder. Thus, the folder "set0" is always empty when checked by TrueImage. An empty folder is the indication for TrueImage to create a fresh full backup during its current backup creation.
:: User must change these next variables and supply their own pertinent information.
A short pdf specific to this task is attached if you want detailed examples.
The 1st post of this thread now contains an attachment for version 2.2 of chain2gen.
User feedback has shown that since chain2gen "knows" when a full backup is being made versus a INCR backup it is in a unique position to run commands prior to "FULL" backups (but not INCR backups).
The most quoted need is run a DEFRAG of one's C:\ drive prior to a FULL (new chain) backup.
but NOT run a defrag for an all subsequent "incr" backups.
V2.2 of chain2gen supports this request.
There is now a set of USER variables called
Into these variable(s) you would place a call to any batch scripts or
program(s) that you want run PRIOR to a FULL backup (new chain).
These commands will NOT be run with EVERY backup, only those backups
where we are creating a NEW chain (FULL).
As said eariler, DEFRAG of your hard disk PRIOR to a new full backup is a typical example.
Normally one would NOT defrag prior to an “incr” backup.
The reason why Acronis views any change to disk (including a file move for defrag) as a changes that needs to be backed up. This means a defrag can make your incr .tib file many gig larger than it otherwise would be.
However if you defrag only before a “FULL” backup is taken then you get the benefit of the defrag without the inflated .tib file cost of the defrag.
The primary downside/consequence using these variables is the runtime for chain2gen.
The typical runtime of chain2gen is a few seconds.
However, if you have "pre_full_backup_cmd(s)" then the runtime of chain2gen will be as long as what your commands require.
The sysout/logfile of chain2gen (error_messages.txt) will contain the start/end timesamps of your "pre" commands.
A typical pre full backup command might be:
set PRE_FULL_BACKUP_CMD1=%windir%\system32\defrag.exe c:
Is there a reason the documentation states that it must be an incremental job? Why would a differential not work?
Either will work. An incremental is used as the example because it the more common and it also consumes less space. This is a very versatile program and the latest addition make it ever more helpful in accomplishing ones backup goals.
Having trouble with syntax on setting a new full backup to occur on Sun and incrementals each other day of the week.
Here's the error:
"Illegal Value in Variable TRGR_ON_DAY1
Here's what I have in the bat file:
:: --User must set this next variable(s) if the preceding option 3 is applicable---------
What do I need to put in that line to get the desired result?
I have these other two settings....are they correct for what I want to do?
I'm NOT a programmer, needless to say. ;)
remove the ~ which is only used when no entry is made to the line.
I believe you will like the program. Read and reread the pdf.
Also ready the FileInventory.pdf. Good luck and come back if you have questions.
Thanks for the fast reply.
I forgot to paste my settings which are:
set TARGET_UNC_N_DEVICE= "r:"
Is this correct for 3 "sets" of backups, each with 1 full backup and 6 incrementals?
Also, can I just temporarily change the count to "2" instead of "7" to test it out and then change it back with no harm done?
yes you can change the trigger params at will with no "harm" done
bear in mind:
if you decrease "max_backup_generations" chain2gen will NOT remove the excess folders.
if you increase the param chain2gen will create the additonal target folders.
if you "play" with what defines a new generation the only "harm" you may end up doing is causing a trigger.txt file to be created which in turn causes the set0 backups to be rotated into history which eventually causes the max generation to roll off (be deleted).
using "trgr_on_max_tib_cnt=7" in theory means a new full backup every week. however, thats only true if you never ever run two backups in one day or conversely never ever turn your pc off. most people who want weekly backups should declare backups on a fixed day such as sunday versus relying on a the count param. Some people specify "trgr_on_max_tib_cnt" of some big value such as '10' as a backup condition to force a full backup eventually if some reason the pc was off sunday
generally you should NOT change the device nor folder params because they need to coordinate with the acronis job itself. - is usually easier to define a new job in that event than try to edit an existing job.
Had oracledba not responded, I would have suggested that the parameter below be changed accordingly as unwanted spaces can be an issue. He probably has program code set to handle such instances.
version 2.3 of chain2gen attached onto first post of this topic
If you are using and older version of chain2gen and NOT using "pre_full_backup_cmd" varaibles then there is little insentive to upgrade. If you are using these variables please download the latest version.
* resolved bug with regard to variable PRE_FULL_BACKUP_CMD[1-5], with this bug only variable #1 was
utilized the other variables looked like they worked but did not.
#2 Per request I have added the the option for “pre_full_backup_cmd” to occur on:
a) only when we are doing a full backup because we are retiring an existing
b) always run regardless of user having an existing backup (chain) or not.
The default chain2gen behavior is to ONLY run your pre full backup commands when the you ALREADY have a backup (chain) and chain2gen is about to do a new full because we are retiring an existing chain.
This is a safer behavior the users potentially destructive action (such as defrag) will only occur if we already have at least some kind of backup (regardless of how current).
If you want the pre full backup commands to run for ANY full backup including the initial FULL backup then your Acronis job must be defined with the word “ALWAYS” as an param/argument.
Please NOTE: When you are defining an new job and click the “test” button with the “ALWAYS” param you WILL be running your pre full backup commands (defrag?) at that moment. If these commands take several minutes (or hours) then it was your choice to click the test button.
It is recommended you click “test” without the word ‘always” and add this word after a successful test without the always param.
The main pdf document has been updated to reflect this change and additional details.
I really, really really appreciate your work. I was stuggling with acronis tasks not working as i was used from other products and was very glad to see that somebody had created a bunch of scripts implementing this missing features.
How ever my setup is not realy triggering a new Fullbackup on sunday and I hope you can help me find my mistake. (please keep you english easy as I'm a german guy, Thanks)
here is my setup:
C:\ (directory to be Backupped via Acronis)
C:\Chain2Gen_v2.2 (directory where all the .bat's and .vba's are)
D:\Backup (directory with the set0-3 where backups shal be destinated too)
config: user_specified_params file
set TARGET_UNC_N_DEVICE= "d:"
The Set0 directory has 1 FULL and something like 20 INCR.
The Acronis Task starts the PreProcessing_bat as mentioned in the PDF.
For my understanding the problem accurs because the Chain2Gen directory is not in the Backup destination directory but I'm not quite sure about that. As I setup this up I read that it is whise to place Chain2Gen on the System Drive cause that will be backupped, but I saw in a screenshot that the set0-3 where in the same directory as all the Chain2Gen Files.
I'm sure you already know whats wrong :-)
thanks alot again and best regards,
Do you have the line:
The "7" tells it to create 1 backup and 6 incrementals (or differentials).
I decided not to start the sequence on Sun and left that section blank because I thought that might be too complicated.
You could change the set TRGR_ON_MAX_TIB_CNT=7 line to set TRGR_ON_MAX_TIB_CNT=2 to quickly test it out like I did; then change it back to 7. That way you can quickly run the backup 3 times to see if it works then delete the 3 resulting backups and start fresh.
The it is typical/expected for chain2gen to reside on the c:\ drive
One reason this is source code and we do want your settings backed up just like any other files/settings you create for other applications.
While Script "Acronis_PreProcessing_task.bat" does a lot its two primary missions are:
1) check if conditions are ripe to create a file called "trigger.txt" in the set0 folder
2) look to see if file trigger.txt exists in the the set0 folder and if so move then contents of this folder into history. (thus leaving an empty set0 folder for acronis).
The contents of trigger.txt does not matter, the mere existance of the file is what counts.
for you to have 20 ".tib" files in your set0 folder means condititions were never ripe for a trigger.txt file to be created. based on the settings posted, either none of those files were created on sunday or your acronis job is not calling the correct chain2gen bat file.
As for your actual settings. its your choice to use either TRGR_ON_DAY# or TRGR_ON_MAX_TIB_CNT (or both). The choice is often based on what window you have to perform a full backup. If you don't care what day your full backup runs on then TRGR_ON_MAX_TIB_CNT is a fine choice. if you only have time for a full backup on sunday ( or simply like the symetry of backups on sunday then use TRGR_ON_DAY#. Some people do both varaibles because they really want the full backup to occur on sunday and they
specify a high value for TRGR_ON_MAX_TIB_CNT (such as 10) to act as a saftey valve in case your computer was off on sunday. the saftey valve also lets you take a few manual backups during the week without causing a pre-mature full backup. An example of where you might want a manual backup mid week is you just finished a big project and want a backup right now versus waiting for tonight.
it is possible to see the effect of your params without taking the time to run the actual backup.
use notepad and create "bogus.tib" file in your set0 folder. now simply double click Acronis_PreProcessing_task.bat and see if it creates a trigger.txt file (or not)
and then moves the contents of set0 into history (or not). you can use notepad to create as many bogus.tib files as you need in the set0 folder to create the conditions you need.
you can also change your system date as needed (please change it back when your done testing). A few minutes testing doing the above should give you 100% assurance chain2gen is working as desired. set conditions one last time to be ripe for trigger.txt and now go run an actual backup from within acronis assuming the job calls our chain2gen preprocessing file you should see the aonis/chain2gen work together and your bogus set0 files rotated into history and an actual new full backup get created.
hope this helps.
I can't really figure out what to do now....
I prefer using the parameter "sunday" as i dont have to bother arround with any kind of dates or months with 4 or maybe 5 weeks.
Acronis is definitely calling the correct file befor starting sceduled backup.
I realy dont know what is going wrong.
Im using Acronis True Image Echo Enterprise Server ist this compatble to Chain2Gen ?
If I place a trigger.txt into the set0 folder on Sunday would it begin a new Chain for sure ?
Does the script move the old Chains into other folder or where do the chains be moved to once the script finds a trigger.txt
Kind regards and thanks again for the time you spend on replying to me.
It seems to me the issue you are having is not related echo its on the chain2gen side and how its being configured/called.
Using sunday is perfectly fine there is no need to change it
you need to an understaing on this and some confidence with chian2gen.
Here is what I would do. every one of these tasks takes just a minute or less to do
we should have this resolved before your coffee gets cold.
step 1) use windows explorer and double click file !_USER_SPECIFIED_PARAMS_FOR_Acronis.bat
step 2) a text string has been placed into your clipboard by step 1. PASTE this string onto the address tool bar of windows explorer.
step 3) you are now in the set0 folder. you should see your "20" .tib files in this location.
If you do not then your acronis backup job is writing its files into the wrong location
if this is the case, delete the job and re-create it using the new correct location.
Furthermore and just as importantly there must NOT be .tib files from OTHER backup jobs
in this folder. This everything in this folder must be unique/specific/dedicate to this copy of chain2gen and your acronis backup job.
step 4) in windows explorer go up one folder level. you should see just 4 items (folders)
set0, set1, set2, set3 (I say this because you said you have MAX_BACKUP_GENERATIONS=3) there really should not be other files at this level if there are its an indication that you did not give chain2gen a its own folder tree to work within.
this folder level and the four set# files belong to chain2gen. It does not mater at all if this folder level we are on now is "n" levels deep from the drive root.
step 5) use windows exlorer go back to your chain2gen and double click !_FORCE_NEW_CHAIN.bat
all this did was create a trigger.txt file for you.
Please confirm this by pasting again the string in your clipboard to the windows explorer address bar. you shoud now see not only the "20" .tib files but also a trigger.txt file.
step 6) use windows explorer go back to chain2gen and double click Acronis_PreProcessing_task.bat
This script will see the existance of trigger. txt and move the entire contents of set0 over to set1.
Please confirm this by pasting again the string in your clipboard to the window explorer address bar. you should now see an EMPTY folder. Set0 is devoide of files.
use windows explorer go up one level and down into Set1.
Here are all the files which ("20" .tib files and the trigger.txt).
At this point we have proved chain2gen as working as designed/intended.
If your acronis backup job were to run at this redhot moment it would perform a new full backup.
what we need to do now is manually move all the files here back to set0
use your mouse single click any of the ".tib" files then hit "ctrl-a" which will highlight all the files.
ctrl-x will 'cut' the files use windows explorer and up one level and then down into set0
hit ctrl-v this will 'paste' all the files back out. At this moment all "20" .tib files and the trigger.txt file are back in the set0 folder. please delete the trigger.txt file.
step 7) At this point we have proved every aspect of chain2gen is correctly configured and working. If you still have not found the issue the it must be the your acronis backup job pretask is NOT calling file Acronis_PreProcessing_task.bat but possibly some other chain2gen file.
please confirm the backup job definition. if it is wrong, delete the job and rebuild it correctly
step 8) at this point you should have a perfectly working chain2gen configuration.
on sunday a trigger.txt file will be created (because on sunday the acronis job started and called Acronis_PreProcessing_task.bat) and in turn set0 will rotate into set1 at which point chain2gen will end, the backup will being and acronis upon seeing an empty set0 folder will have no choice but create a new full backup. hence starting a new chain.
Hope this helps.
thanks again for your mega long reply.
I did step 1 and it showed me that :this Folder DOES excist and that my clip board does contain the string: d:\backup\set0 which is fine but when i try to past it into the adressbar of the explorer it doesnt past anything, seems like there is nothing in the clipboard at that time....
maybe their is some security option of windows 2008 server blocking this script putting data into clipboard ? I'm sure this worked (clipboard) when setup Chain2gen initial. why shouldn't it work now....
i'll move the 2 TIB's into Set1 now manually and what for your reply on monday.
Thanks alot and kind regards,
the clipboard feature was created strictly as a measure to the user to prevent typos.
Most users make the mistake in thinking that the .tib files will flow into d:\backup\ not d:\backup\set0 other users simply change their minds and setup acronis one way and chain2gen another and they are not in sync. The clipboard was a means to ensure the two were in step.
Dont have 2008 server and can't help you with regard to the clipboard. but it is not material to how chain2gen behaves, reconmend you put d:\backup\set0 in your clipboard manually and follow all the steps.
If you do you should be able to prove today that your backup on sunday will be the new chain you expect. If it will not be you will know exactly what is wrong and how to fix it so it will be.
I was having the same problem as Marcel. I wanted a new Full backup to run on Mon but when I run Acronis_PreProcessing_task.bat the date trigger never activates. Some of the other triggers DO work but none of the date driven ones.
After much banging my head against the wall. i tried to launch Acronis_PreProcessing_task.bat from a command prompt and would you believe it works fine (at least for the run on Mon argument).
I have tried this 5 times ...if I run by clicking the batch file, it fails to trigger the date condition; if I launch the batch file in a Command Window, it works great!
Now what?? There MUST be a simple solution for this (I hope).
ALSO, if I run validate_params.bat by clicking on it, it tells me that NOTHING is defined. Even those items that I know it "sees", because it creates set4 or set5 if needed (in the correct location), or triggers on max # of tib files even though the DayOfWeek fails to act as a trigger.
If I run validate_params.bat from the Command Window (DOS Prompt) it works fine and nothing is reported as missing. Error_Messages.txt does not get created when run from DOS.
David thank you for your in depth analysis.
I think I have found the solution.
I and others will test further to confirm. Once confirmed I will publish chain2gen v2.4
In the mean time for anyone who wants the proposed solution right now.
Here is what casual testing shows is the solution, replace these two chain2gen files.
further testing will occur over the next few days.
If anyone tries this code please PM me with if the test was successful (or not)
The problem appears to be resolved, except that if you run Validate_Params.bat there are still issues...
I attached screen shots showing that it reports that none of the variables are found (which of course is not true as the program works). Also, it reports that it can not locate popup_countdown_alert.vbs at line 79, and no error log is generated.
Other than that, it seems to work very well.
You've done a terrific job in putting this together. To me, this was the last missing piece in the Acronis backup system.
If you need the next version tested, I'd be happy to lend a hand.
Thank you again,
The new date code is working fine with my testing of creating a trigger.txt file on the weekday selection.
Since one of the requirements of C2G is that it needs a complete set of files in separate individual folder for each Acronis Task utilizing C2G. I have found when troubleshooting an issue, one thing to be very helpful is to open a command window inside the dedicated folder containing all the c2rg files for that particular task. Then run the parms file and the preprocessing file from the command prompt. At the completion of running each batch file, execute the SET command from the prompt and all the user supplied variables (use full open window) will be displayed. This allows the user to examine each user supplied variable to make sure the path listed is the desired path and any other user parameter is properly displayed.
I have also found this to be a very valuable tool - many thanks. I had the same problems (not triggering on a day of the week) - but these have been resolved with the latest versions (2.4).
I also have the same syptoms as David - i.e. validate params is not working.
Many thanks for everything you have done with this. I agree that it is a significant improvement on the basic Acronis functionality. However, I wonder if it would be possible to go even further ....
This thread is entitled "How to do backup generations (Grandfather, Father, Son)". As I understand it, this tool allows me to create daily backups, and every week, to automatically create a new set, thus ensuring that I am not dependent on the integrity of a large number of files in order to go back to a particular date. However, I cannot afford (and have no need) to keep daily backups (or even weekly backups) for a long period of time.
What I would really like to do is to create a true G-F-S scheme. For example, I would like to be able to do daily backups (using a mix of full & incremental) over a month (Son), and at the end of a month, to save a copy of a full backup (Father). I would then like to archive a monthly copy say once every three months (Grandfather). This way, I can afford to save data over a much longer period of time (admittedly, at the expense of only having infrequent copies to refer to).
I wonder if it would be possible to create something like this by extending the scripts. Perhaps have a folder called Older (for Father) and within that Oldest (for Grandfather). Would need to be able to specify how many copies in each folder, and what the trigger conditions would be (e.g. First of the month).
Thank you for reporting the proposed zip file have resolved the situation for you
I will take the files you tested and publish full 2.4 zip in the main posting later this weekend.
As for the GFS behavior you mention.
I'm not sure I fully understand the behavior you want.
But it sounds like your saying
on the 1st of the month your willing to take the time to perform a full backup
for the remainder of the month you only want to take the time to perform incr.
on the 1st of the next month what gets rotated into set1 need only be the original full backup and none of the daily incrs made.
obviously when we rotate into 1 what was in one gets push up (and so on)
The above behavior means that you can restore to current day,
as well as giving you the abiltiy go back in time ONLY within the current month.
prior generations would be ONLY be the FULL backup from that month.
If this is what your saying an easy solution is to write a fairly easy batch script to be called as post backup task
This script would determines the date of the earliest tib file in set1.
This script would then delete all tib files in set1 which were not of the date just determined.
This would retain in set1 just the file(s) of the full backup and eliminate all the subsequent daily incr of that prior month.
Obviously this post backup script could be called every day but it would only
be on those days when a new chain was made (the 1st) when it would do real actual work.
At this point I will let reader(s) of this reply write such as script
if you do your welcome and post it as your own add-on to chain2gen. I do not want to write and test such a script right now but if the capability is important to you or others it is something that is fairly straight forward to write.
as for the "issue" being reported with validate params not working.
That script was never intended to be run stand-alone
If you do run it stand-alone it will correctly report that a whole bunch of things are un-defined.
This script was designed to be internally called by !_USER_SPECIFIED_PARAMS_FOR_Acronis.bat
This script file of course is the one you hand edit.
Because the user edits this file, I need to check/validate their data entry before using it.
This check occurs each and every time !_USER_SPECIFIED_PARAMS_FOR_Acronis.bat is run (either interactively by double clicking it
or as part of Acronis_PreProcessing_task.bat which of course is what your arconis backup pre-task calls.
So yes, validate params is working as designed it simply was not intended to be directly run.
Firstly, a thank you to oracledb for such a serious and well thought-out piece of work - it's good to see such practical commenting.
Unfortunately, I'm having a problem generating a backup chain. I have set the following parameters:
The preprocessor is set to run Acronis_PreProcessing_task.bat
There is no defrag set to run and all folders are created.
When the first backup is run, the 0 KB file in the target directory is named ProgramBackup-1.tib. When the backup is finished, this changes to ProgramBackup-.tib.
Running a subsequent backup gives me the following Operation Progress:
Carrying out user command
In Directory "C:Chain2Gen\Programs\"
(1 of 3)
Acronis then hangs and the backup cannot be cancelled without ending the processes in Task Manager.
What am I doing wrong?
I do not know what is the issue but the first places to start are:
anything useful found in sysout file error_messages.txt?
anything unusual happen if you simply double click acronis_preprocessing_task.bat?
is drive "H:" guaranteed to be connected/live at the time of the backup?
if not you probably need to use helper program drive notify - see groverh's signature.
there is a bug in v2.3, I do not think your hitting it but its always easier to speak to the current version. v2.4 is not yet published in the main post, make it with the 2.3 zip file and the zip file from post #30 of this thread.
When the first backup is run, the 0 KB file in the target directory is named ProgramBackup-1.tib. When the backup is finished, this changes to ProgramBackup-.tib.
That is the expected action and based on your specs, the backup file must be located at H:\Acronis\PROGRAM\set0\ProgramBackup-.tib and the file size should be whatever is normal for the type of backup being created.
Is the "H:" an external drive? If yes, it must be attached and recognized by Windows before the backup can run.
Likewise, if H: is an external drive, it must be attached and recognized during any editing or creation of a task directed to that drive.
When TrueImage is running, the TI icon in sys tray shows the percent of completion. If it remains at 0 percent, it is waiting for something else to occur.
I replaced thoses 2 files (datefix.zip) and pressed preprocessing manually on Sunday (my New chain day) and it created the trigger file + moved the data into the next set directory.
Im sure next sunday it will perform this by it self and do the new chain afterwards.
For me, my issue is solved.
Thanks for all your support.
I think I might have found a bug in the Acronis_Preprocessing_Task.bat script at the following lines:
:: Determine if a tib file was created in this folder today if so set variable to true/false (1/0)
:: this variable is used only when multiple backups occur in one day and that day is a trigger event.
:: for example - user wants new chain on sunday and today is sunday.
:: then 1st backup on sunday will be the user desired new chain however any addtional backups
:: also made this same sunday will NOT be a new chain but INCR on to the existing chain.
FOR %%q IN (*.tib) DO FOR /F "tokens=1-5 delims=/: " %%J IN ("%%~tq") DO (
if "%DateYear%_%Datemonth%_%Dateday%" == "20%%L_%%J_%%K" set TIB_created_Today=1
In my system, the file date is shown as "19/01/2010", so %%L evaluates to 2010, %%J is the date and %%K is the month, so I don't think that the "if" statement will ever work on my machine. I am using the UK localisation (ie. dates are formatted as dd/mm/yyyy), and I guess that this is the cause of the discrepancy. Is there any way of fixing this and making it independent of the localisation?
your analysis is correct, the code was assuming a particular date format and did not consider that format can vary by region. I'm sure this can be resolved some other way thanks posting the issue.
Engeeaitch - the bug you reported has been resolved in v2.5 please PM me if you do not agree.
To those that have PM'd me directly with bug reports.
These have been resolved in v2.5
again - please PM me if you do not agree.
V2.5 can be found on the 1st post of this topic.
Marcel and for that matter anyone else using chian2gen who is not on the current version. Yes if your not on chain2gen 2.5 you probably aught to be.
The general instructions for upgrade/update chain2gen:
make copies of the two existing files: !_USER_SPECIFIED_PARAMS_FOR_Acronis.bat
extract the latest version zip file into your current chain2gen folder letting the extract overwrite any existing files.
hand edit the new/virgianl user params file and set the params you had from the original using either copy/paste between the records or simply retyping the value.
if you use the "my_acronis_pretask.bat" script edit the viriginal script and merge in the changes you made.
To Oracledba, thank you again for all your hard work. At this point, I think that everything is functioning as designed. this is surely the missing piece of the Acronic Backup program - perhaps they will incorporate this functionality into a future version (certainly, they should!).
I am having a "hang" problem similar to Philip Avery. Has this been resolved?
If the preprocessing file finds the set0 folder empty, it proceeds with a full backup. Good.
If the preprocessing file finds the set0 folder has *.tib files, but does not need to create a trigger.txt file to move to a new backup generation, it makes a incremental backup. Good.
HOWEVER, If the preprocessing file finds that it must create a trigger.txt in the set0 folder, it WILL create the trigger.txt file but then it just hangs before it even copies that generation of *.tib files to the set1 folder. At that point, Acronis says 0% complete, and there is no way to cancel or stop it without killing the process from the task manager.
I'm using Chain2Gen v2.5. In my testing, the trigger.txt stuff used to work in v2.2 (on certain options, like set TRGR_ON_MAX_TIB_CNT=7), however, i upgraded to 2.5 because I need to create a new full backup on Saturday and that day function was not working properly.
The backup is going to a NAS but I'm sure it is not disconnected from the network -- especially considering that the program is able to create the trigger.txt file.
Your issue has not been reproduced in my testing or others. Thus far everyone has reported v2.5 is working as expected including type of backup you desire where you create new chains on saturday.
I do have one thought/question for you...
Any chance that your param file includes one or more commands for the variables PRE_FULL_BACKUP_CMD[1-5]?
The reason I ask is these are user defined commands that are to be performed just prior to new a new chain being created.
A typical command might be to perform a defrag.
It so happens that during the entire duration of these command(s) the outward behavior of chain2gen/acronis will appear exactly as you described.
If your defrag takes an hour or more than for that entire hour chain2gen will appear in a hung state with the trigger.txt file created but otherwise everything at 0% as we wait for the defrag to finish.
If further research into your issue is needed please post a reply.
I found the problem while MANUALLY running the Acronis_PreProcessing_task.bat file: When I double-clicked on it manually, windows [server 2003] displayed a security dialog box warning me that the file (because it was *.vbs) could be unsafe, was i sure i wanted to proceed? I clicked Yes and it worked as it should (trigger.txt created, *.tib files moved from set0 to set1 folder).
So I manually launched Acronis_PreProcessing_task.bat again and when the security dialog came up, I used the checkbox to opt-out of further security warnings for *.vbs files...
Now everything works as it should when acronis runs a backup job calling the chain2gen scripts. However, have I created a security risk?
Thank you very much :)
YOu don't have to change security policy system-wide. If you right click on each of the .bat and .vbs files in chain2gen and click properties, you can set them to "unblocked". You need only do this once for each of these files and you won't be bothered again.
On a separate note, I tried to install ATI Home 2009, on a Win2003 Server but the installation would not launch. Is that the version of ATI you are using?
The issue and solution is documented on page 2 of the PDF and appendix C of the PDF. The issue occurs only on those pc's with specific security settings enforced.
clicking the unblock was the correct action on your part, you have not created a security risk. When you clicked that button you simply said you trusted that specific .bat file or .vbs file to not be a virus/trojan. Since many others are using that same code, and the fact that you can see the code first hand using notepad your are assured that the code is safe.
Based on what you described I do NOT think that you are done yet.
The very fact that had to do the unblock action for one script means you will need to do it for ALL chain2gen scripts of the same extension (*.vbs) and on some pc's *.bat.
your solution is in appendix C of the pdf (page 23).