>one last question (promise) ...

Oh, sure.  How many times have we heard **that** line?  :-) :-) :-)

>... how does amanda figure out what to dump and when to 
>dump? I mean what is the algorithm? I haven't been able to figure this 
>out and yet it must be documented somewhere. 

There are really two questions here, and I'm not sure which one you're
asking.  My apologies if the first is obvious to you and you really
wanted the answer to the second.

One question is "which files are backed up when I dump disk X on
client Y".  That algorithm is not part of Amanda, it's part of whatever
dump program you're using.

With the dump programs Amanda currently supports, it's based on comparing
the last modification/change time on each item with some reference and
doing everything that appears to be new or altered.  The reference is
called a "level".  Level 0 is special and means "dump everything".
Level 'N' means dump everything new or changed since the last level
less than 'N'.  For instance, a level 1 will compare against level 0.
A level 2 will compare against either a level 1 or level 0, depending
on which was done most recently.

The next question is "what level does Amanda use".  To make that decision,
Amanda (planner) first asks how big dump images will be for the levels it
might end up using.  It always asks for the size of a level 0 (full dump).
It usually asks for the size of the same level that it ran last time.
And it may ask for the size of the next higher level based on the "bump*"
parameters that control how often it is allowed to go up a level.

Then it analyzes all the estimates it gets back.  If it is time for a
level 0 (see below), that's what is picked.  Otherwise it picks one of
the two possible incremental levels (the same as last time and the next
level) based on whether it is time to bump (bumpdays) and whether it would
save enough space by going to the next level (bumpsize and bumpmult).

When to do the next level 0 is based on several things:

  * "amadmin <config> force" forces a level 0

  * strategies "nofull" and "incronly" never (in theory) do a full

  * strategy "noinc" always does a full

  * new disks always do a full

  * when the last full was done plus dumpcycle determines when to do
    the next full

  * and more below

At this point, planner has what is called the "initial schedule" (you
can read along with all of this in an amdump.<NN> file).

Next, planner compares the total size to dump against the tape size and
delays dumps to get it to fit:

  * any dumps are larger than a tape are deferred since they will
    never fit

  * the lowest priority full dumps are demoted to incrementals

  * incremental dumps are deferred until the next run

Next, planner promotes some incrementals to full dumps if there is room.
The goal is to balance the size of the level 0 dumps done during
every run.

At this point, the final schedule is set and it is passed to driver
to process.  The only thing that can change what happens after this is
if there is a tape error and Amanda drops into "degraded mode" where it
may do an incremental rather than the requested full dump, depending
on the "reserve" parameter.  It may also start skipping dumps if the
holding disk fills.

There is more about this in the papers at ftp.amanda.org.  And the best
place, of course, is the planner.c code itself (which is what I just
read through and translated to the above).

>Ross

John R. Jackson, Technical Software Specialist, [EMAIL PROTECTED]

Reply via email to