I'm trying to get Unison to sync between two folders, but on one side, if I don't have the existing folder, it tries to delete the other side (the folder with everything in it). So if I have


If I delete folderB, and then run unison -auto -batch -prefer newer folderA folderB, it will try and delete folderA instead of creating folderB and copying the contents of folderA over to folderB.

Is this possible? It may sound like a weird request, but it's because I'm creating syncing scripts where new systems won't have folderB sometimes, and I don't want the computer to think that means folderA needs to be deleted.


1 Answer 1


This shouldn't be an issue. Unison is deleting folderA because you, after telling Unison that folderA and folderB should be synchronized, deleted folderB, so of course Unison wants to delete folderA to keep things syncronized. But you said the cases where folderB doesn't exist will be on new systems that, I presume, you haven't synced with folderA before (so there are no archive files for this pair of roots). So when you run

unison -auto -batch -prefer newer folderA folderB

where folderB doesn't exist, Unison should happily create folderB.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .