How Multi-way Synchronization Works

When you synchronize two or more Source folders, it is known as multi-way synchronization. A Source folder is a location which qFileSync looks for new files. qFileSync can automatically copy files from Source folders, but it will never copy files from Mirror or Merge folders. For information on one-way synchronization (to Mirror and Merge folders), click here.

I suggest you understand this section well before trusting qFileSync with your data.

The fundamental basis for a synchronization is file dates. Every file has a date stamp (the last modified date) which is updated every time you save a file. Given two copies of the same file, where one has a later date, it is often safe to overwrite the older one with the newer one. qFileSync 2.x was just this simple: figure out which copies of which files are newer and copy them. However, there are a number of ways in which this logic can fail.

For example, suppose you change two copies of the same file: qFileSync 2.x would overwrite the older file with the newer one, and you would forever lose the changes made to the other file. And suppose you delete one copy of the file. Generally you would want the other copy to be deleted as well, but qFileSync 2.x would instead tend to copy the old file to the folder it was deleted from. This means that the user must manually delete the file from both locations.

qFileSync 3.x, however, is smart enough to deal with these situations intelligently, by using the last synchronization date, and by introducing the concept of conflicts.

Conflicts

A conflict is a situation where it is not clear what qFileSync should do. There are two typical reasons conflicts arise:

  1. Changes are made independently to two different copies of a file. For example, I often synchronize documents between my laptop and desktop computers. If I make changes to document X on both computers between syncs, it becomes a conflict.
  2. qFileSync cannot tell how a situation came about; therefore, it does not know what action to take. For example, suppose that you synchronize two folders, A and B. Suppose that A but not B contains file X, and that B but not A contains file Y. Further, suppose that the date stamp on both X and Y is before the last sync. Now, there are two typical ways this situation could have arisen:
    1. X and Y existed during the last sync, but then X was deleted from B, and Y was deleted from A.
    2. Y is actually X, but it was renamed from X to Y after the last sync.

    Depending on what caused the situation, qFileSync should either delete both X and Y (situation #1), or delete X and copy Y to folder A (situation #2).

qFileSync examines folders on a file-by-file basis; for example, if you are synchronizing locations A and B, which contain a file X, the conflict and/or action to be taken regarding file X is based solely on the properties of the copies of X in A and B. qFileSync never notices any similarity or relationship between files of different names or relative paths.

Certain situations are considered conflicts, while others are not; what is and is not a conflict is defined in qFileSync.ini. This file comes with qFileSync, and defines four distinct types of conflicts. These are as follows:

qFileSync's behaviour when conflicts arise is controlled by the Conflict Resolution Options dialog box.

The only situations not considered conflicts are those in which:

  1. No source files exist (in other words, a file exists in a "mirror" location with no matching source files), or
  2. The file is present at all source locations, copies of the file after the last sync date (if any) all match, and copies of the file before the last sync date (if any) all match. In this case the newer version of a file is copied over the older version, no questions asked.

Pitfalls

There are diverse ways in which the conflict-detection mechanism can behave unexpectedly; the main problem is the many ways in which the last sync date ("LSD") can become incorrect with respect to the files being synchronized. Here are some examples of how this can happen, and what negative effects may result from it.

Please e-mail me if you discover other ways in which qFileSync can behave in an unexpected way.

Table of Contents

Hosted by www.Geocities.ws

1