0

How i can use unison to sync folders with the latest modification time of its file

Example :- folder_1/file.txt changed at 12:30 folder_2/file.txt changed at 12:35

i wanna execute ./unison to give me the following result :- update file with regards to latest modification time so that update file folder_1/file.txt to became the same file folder_2.file.txt

Eng Al-Rawabdeh
  • 15
  • 1
  • 11

1 Answers1

1

You can't.

Unison works by comparing both files with their last synchronized version. If both have changed, and the end result is not identical, they are marked as a conflict. Although in that case a merge program can be invoked to resolve the conflict, the modification time plays no role at all in the whole process.

From the manual:

Note that whether a path is updated has nothing to do with its last modification time—Unison considers only the contents when determining whether an update has occurred. This means that touching a file without changing its contents will not be recognized as an update. A file can even be changed several times and then changed back to its original contents; as long as Unison is only run at the end of this process, no update will be recognized.

sleepyMonad
  • 989
  • 8
  • 13
  • What about with the `merge` option for *.txt files? I'm looking for a method to always favor the _older_ for *.last files – Marcos Mar 15 '12 at 08:37