Incremental Backup (Dump)

nnbackup.exe dump 0 -i c:\data -o d:\backup\data\ [options]

Incremental backup is a very effective and reliable way of backing up your data. Its main advantages are its high speed and high flexibility as far as fine-tuning is concerned: depending on the amount of data you need to back up, you can select a backup level that will reduce the time required to restore your data (especially when you are backing up great amounts of data).

The incremental backup mode is similar in its functions to the popular Unix utility dump, and it allows to create full initial backup of the source directory and then "add" to it the files that has been changed since the last backup session.

A backup session in this mode is called "a dump". Each backup session (dump) is assigned its own number (an integer from 0 to 9); this is a backup level that determines which files will be copied.

The rules are as follows:

I'll illustrate the rules with an example. Let's suppose that on 26th of November, 2002, we want to create a level 0 dump containing a full copy of source data; in order to do that, we start nnBackup as follows:

nnbackup.exe dump 0 -i c:\data -o d:\backup\data\

This command will result in a zip file d:\backup\data\0_2002-11-26.zip, which will contain all the data from c:\data. The next day, we shall run nnBackup as follows (level 1 dump):

nnbackup.exe dump 1 -i c:\data -o d:\backup\data\

As a result, we shall get a zip file d:\backup\data\1_2002-11-27.zip which will contain only those files that have been created or modified after the moment of the level 0 dump.

Accordingly, the level 2 dump (d:\backup\data\2_2002-11-28.zip) will only contain files that have been created or modified after creation of the level 1 dump, and the level 3 dump (d:\backup\data\2_2002-11-28.zip) will only contain files that have been created or modified after creation of the level 3 dump etc.

You don't have to assign your dumps successive numbers. The next day after creating a level 2 dump, you can create a level 5 dump, and it will contain those files that were created or modified after you had created the level 2 dump.

Clever handling of dump levels will give you a complete control over the content of your archives which will save your time during restoring the data. Instead of creating a series of consecutively numbered dumps (and dooming yourself to consecutively uncompress all the existing dumps when restoring the data), it would be wise to alternate the dump levels. For example, the following pattern of dump backups is very popular in UNIX environment:

0, 3, 2, 5, 4, 7, 6, 9, 8, 9

Here this scheme is "spelled out":

0 3 2 5 4 7 6 9 8 9
| | | | | | | | | |
0 means a full backup.
  | | | | | | | | |
  3 means copy all files new or modified since level 0 and 3.
    | | | | | | | |
    2 means copy all files new or modified since level 0 and 2.
      | | | | | | |
      5 means copy all files new or modified since level 0, 3 and 5.
        | | | | | |
        4 means copy all files new or modified since level 0, 3 and 4.
          | | | | |
          7 means copy all files new or modified since level 0, 3, 4 and 7.
            | | | |
            6 means copy all files new or modified since level 0, 3, 4 and 6.
              | | |
              9 means copy all files new or modified since level 0, 3, 4, 6 and 9.
                | |
                8 means copy all files new or modified since level 0, 3, 4, 6 and 8.
                  |
                  9 means copy all files new or modified since level 0, 3, 4, 6, 8 and 9.

And this table will explain which dumps will you need to uncompress when restoring your data on various days (for this example's purposes we shall assume that you copy your backups to a magnetic tapes). Of course, the less frequent you create level 0 dumps, the more tapes will you need in order to restore your data:

Tape Level Backup (days) Restore tapes
10N.A.1
2311, 2
3221, 3
4511, 2, 4
5421, 2, 5
6711, 2, 5, 6
7621, 2, 5, 7
8911, 2, 5, 7, 8
9821, 2, 5, 7, 9
10911, 2, 5, 7, 9, 10

Keep in mind that in dump mode (as well as all the other modes) you can fine-tune the program's behavior by specifying what types of files should be processed. For example, you can use inclusive or exclusive filename masks (-m, -x), filters of the creation and/or last modification date (-D, -DC, -DW), file size filters (-LT, -GT) and file attributes filters (options -a, -ax).

Several of the nnBackup's command line options were expressly created to be used in the incremental backup mode: more.

The -nocopy option will allow you to test the command line that you are going to use: nnBackup will imitate the process of creating a dump, but the files won't be actually copied:

nnbackup.exe dump 0 -i c:\data -o d:\backup\data -v -nocopy

Examples:

nnbackup.exe dump 0 -i c:\data -o d:\backup\data -v 

Explanation: Create a level 0 dump containing all the files from :\data and saving it to d:\backup\data. The dump's name will look approximately this way: 0_2002-12-05.zip. While copying the files, nnBackup will display/write to log the full file paths.

nnbackup.exe dump 2 -i c:\data -o d:\backup\data -s -v 

Explanation: Create a level 2 dump containing all the files from :\data and saving it to d:\backup\data. The dump's name will look approximately this way: 2_2002-12-05.zip. While copying the files, nnBackup will take in account all subdirectories in c:\data and display/write to log the full file paths.

nnbackup.exe dump 3 -i c:\data -o d:\backup\data -s -v -dn "data-backup_%DumpLevel @%_%MM%-%DD%"

Explanation: Create a level 2 dump containing all the files from :\data and saving it to d:\backup\data. Specifying the dump name: data-backup_3_12-05.zip. While copying the files, nnBackup will take in account all subdirectories in c:\data and display/write to log the full file paths.

nnbackup.exe dump 0 -i c:\data -o d:\backup\data -v -nozip

Explanation: Create a level 0 dump containing all the files from :\data and saving it to d:\backup\data. The dump won't be compressed to a zip archive. The name of directory where the files will be saved will look approximately this way: d:\backup\data\0_2002-12-05. While copying the files, nnBackup will display/write to log the full file paths.


See also: