Resolving Bidirectional Sync File Conflicts

When run in bidirectional mode, Sync reports file conflicts when a file was modified on both endpoints and Sync cannot determine which version to use.

For example, you have computer A and computer B and you want to synchronize the following directory and files on both computers:

My_documents
–--Document1
–--Document2
–--Document3

If Document2 is changed on both computer A and computer B, then when you run the async session, Sync reports the conflict:

async -N my_bidi_sync -d /my_documents -r colleague@B:/home/my_documents -w pass -K bidi
/              SYNCHRONIZED
/Document1     SYNCHRONIZED
/Document2     CONFLICT
/Document3     SYNCHRONIZED

Both versions of Document2 are left intact and you must manually resolve the conflict between them.

Resolve the conflict using one of the following methods, depending on if you have access to both endpoints (use method 1 or 2), which changes you want to preserve, and how soon you need resolution:

1. Reconcile the files

The slowest method, but it preserves changes and resolves the issue immediately (once files are edited).

If you have access to the file on both endpoints, compare the files and edit them until they are no longer different. To use a utility like diff, use ascp or other means to copy the remote file onto your local computer in a different directory from the local conflicted file.

Verify that the two files are no longer conflicted by comparing their checksums. Run the following command for each file to calculate its checksum:

# md5sum filepath

If the checksums match, then you can run the async session again and the files are synchronized without conflict.

async -N my_bidi_sync -d /my_documents -r colleague@B:/home/my_documents -w pass -K bidi
/              SYNCHRONIZED
/Document1     SYNCHRONIZED
/Document2     SYNCHRONIZED
/Document3     SYNCHRONIZED

2. Delete the conflicted file from one endpoint

A faster method, but it does not preserve changes on both sides and requires access to both endpoints.

If you have access to the file on both endpoints, compare the files and determine if the changes to the conflicted file on one endpoint do not need to be preserved (such as if they duplicate changes on the other endpoint or they add obsolete or incorrect information). If changes on both endpoints need to be preserved, use one of the other methods.

Delete the file that has changes you do not want to preserve and run the Sync session again. The version with the changes you want to keep is synchronized between the two endpoints. For example, if the changes to Document2 on computer B do not need to be preserved, delete Document2 on computer B and then run the session again. All files are synchronized.

3. Rename the conflicted file on one side

The fastest method, changes on both sides are preserved but in separate files, allowing you to resolve the original conflict after synchronization. Requires access to only one endpoint.

If you only have access to one endpoint, want to preserve changes on both sides, but do not want to resolve the conflict immediately, you can rename the conflicted file on one endpoint. When you run the async session, both endpoints have the two versions of the conflicted file. You can then compare the differences between them and make edits to the original file later.

For example, rename Document2 on computer A to Document2_computerA. When you run the async session, computer A and computer B both have the following files:

async -N my_bidi_sync -d /my_documents -r colleague@B:/home/my_documents -w pass -K bidi
/              SYNCHRONIZED
/Document1     SYNCHRONIZED
/Document2     SYNCHRONIZED
/Document2_computerA    SYNCHRONIZED
/Document3     SYNCHRONIZED