Pretty much everyone understands full and incremental backups in NetWorker. A full backup is a backup of everything, and an incremental is a backup of everything that has changed since the last backup, regardless of what level that is.

On the other hand, differential backups can sometimes throw people out for a while longer; particularly since NetWorker is more flexible and offers 9 differential levels.

I like to visualise backup levels as follows:

Full, Incr, Incr, 5

Figure 1: Full, incr, incr, level 5

This represents a full backup (which is drawn as a “line in the sand”), two subsequent incrementals, and a level 5 backup following the second incremental.

The first incremental backs up everything that has changed since the previous backup, which in this case is a full, thus the end-point for its arrow is the full backup line. The second incremental again backs up everything that has changed since the previous backup – the first incremental. As such, its arrow end-point is the first incremental backup.

Finally, the level 5 backup bypasses the incrementals and backs up everything that has changed since the full, so its arrow end-point goes all the way back to the full.

If you’re wondering about what makes the differential level 5 significant there – nothing. It doesn’t matter whether you use a 5, 3, 2, 8, etc. The differential numbers only have significance when you use more than one of them in a single schedule. For instance, the above backup could have been equally achieved with:

Full, Incr, Incr, 1

Figure 2: Full, incr, incr, level 1

This allows us to establish our first set of criteria for differential levels:

Rule 1: If only using one differential level in a schedule, the number is irrelevant.

Guideline 1: If only using one differential level, start in the middle. That way, if you have to slot in another differential level later, you’ve got room on ‘either side’.

Differentials in NetWorker become more complex when you have more than one level involved. Let’s consider a slight change to the above level diagram:

Full, Incr, Incr, 5, 1

Figure 3: Full, incr, incr, level 5, level 1

In this, we’ve got a fairly standard appearing set of levels until we hit the differential level 1; this follows a 5, and backs up everything that has changed since the full. If we turn to the nsr_schedule man page for a clarification here, we see:

“The levels 1 through 9 cause all files to be saved which have been modified since any lower level was performed. As an example, if you did a full save on Monday, followed by a level 3 save on Tuesday, a subsequent level 3 save on Wednesday would contain all files modified or added since the Monday full save.”

So this leads to our second set of criteria when dealing with differential levels:

Rule 2: Any differential level will backup all files which have been modified since any lower has been performed.

Guideline 2: Think of a full backup as ‘level 0′, and the differential rules make more sense.

Thus, if we swap around the two differential levels in the above diagram, our backup behaviour becomes markedly different:

Full, Incr, Incr, 1, 5

Figure 4: Full, incr, incr, level 1, level 5

The behaviour up to and including the level 1 backup mirrors what we saw in figures 1 and 2 – incrementals going back to the full, and the first differential performed also going back to the full. However, the level 5 backup will only backup those changes which have occurred since the level 1 backup – 1 is lower than 5, so it will “cause all files to be saved which have been modified since any lower level save was performed” to be triggered when the 5 is run.

Our last example for consideration is what happens when we throw another differential level in; let’s go for a level 3:

Full, Incr, Incr, 1, 5, 3

Figure 5: Full, incr, incr, level 1, level 5, level 3

Focusing on the “since any lower level save was performed”, if we do a level 3 backup after the level 5, it too will backup all files that have changed since the level 1 backup, incorporating not only the changes in the level 5 backup, but any changes since that point.

To the uninitiated, NetWorker’s differential backups may seem a little challenging, but once you get the hang of them via the two sets of guidelines above, you’ll find they’re very straight forward.

 

One question I’m often asked by people who haven’t used differential levels within NetWorker is what is the purpose of the different levels? In particular, this tends to lead to if I’m going to implement a differential backup, what level should I choose?

While multiple differential levels grants considerable extra flexibility to NetWorker backups schedules, it can be confusing to the uninitiated. After all, if you’re currently only using fulls and incrementals, but want to insert a differential level, should you choose a level 1, level 2, level 3, etc.?

If you’re only using one differential level, it really doesn’t matter which level you use (though I have a suggestion); that is, all 9 differential levels interact with fulls and incrementals in exactly the same way when they are the only differential level used.

For this reason, if I’m only using one differential level in a schedule, I tend to use level 5. There’s a very simple reason for this – if at a later point I need to insert additional differential levels, then I can insert either lower or higher number levels around the 5 without having to change the level I’ve already been using, and with maximum flexibility as to the number of differential levels I can insert.

Now, how do they relate to one another?

  • A differential level 1 will backup all changes since the last full.
  • A differential level 2 will backup all the changes since the last full or the last differential level 1, whichever is most recent.
  • A differential level 3 will backup all the changes since the last full or the last differential level 2, or the last differential level 1, whichever is most recent.
  • etc.

I.e., any differential level X will backup all files that have changed since either the last full or the last X-n level backup, whichever is more recent.

Now, in weekly schedules, there’s usually little point in using multiple differential levels. Where they come into play more usefully is in monthly or even more lengthy schedules such as quarterly backups. I’ve previously discussed using differential levels in monthly schedules here, and in my book I give a reasonably complete example of quarterly full backup schedules for small-change low-access servers.

© 2012 The NetWorker Blog Suffusion theme by Sayontan Sinha