On 2023-07-06 13:19, Carlos E. R. wrote:
Hi,
In unison profile, is there a way to say that a file should always be copied in a certain direction, always the same?
Got it from an answer in Usenet, suggesting at "force xxx". The syntax is not obvious from the manual, and I found no examples anywhere. The profile that works is: label = ssd250_cripta - (cer is computer) root = /home/cer/Cripta/ root = /media/ssd250_xfs_c/cer/Cripta/ path = keys/flagT.kdbx path = keys/flagE.kdbx forcepartial = Path keys/flagE.kdbx -> /media/ssd250_xfs_c/cer/Cripta/ forcepartial = Path keys/flagT.kdbx -> /home/cer/Cripta/ I edit flagT.kdbx in "/media, GUI says will copy the file from computer to /media, undoing the edit, which is what Ii need. The manual doesn't say that forcepartial and preferpartial needs that the files also appear in "path" earlier, took me many tries to find that out. forcepartial xxx Including the preference forcepartial = PATHSPEC -> root causes Unison to resolve all differences (even non-conflicting changes) in favor of root for the files in PATHSPEC (see the Path Specification section for more information). This effectively changes Unison from a synchronizer into a mirroring utility. You can also specify forcepartial PATHSPEC -> newer (or forcepartial PATHSPEC older) to force Unison to choose the file with the later (earlier) modtime. In this case, the -times preference must also be enabled. This preference should be used only if you are sure you know what you are doing! preferpartial xxx Including the preference preferpartial = PATHSPEC -> root causes Unison always to resolve conflicts in favor of root, rather than asking for guidance from the user, for the files in PATHSPEC (see the Path Specification section for more information). (The syntax of root is the same as for the root preference, plus the special values newer and older.) This preference should be used only if you are sure you know what you are doing! -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)