Unison: don't treat root folder deletion as something that needs to sync?

0

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

/folderA/fileA
/folderA/fileB
/folderB/

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.

Max

Posted 2018-07-11T17:19:22.460

Reputation: 3

Answers

0

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.

Mike Pierce

Posted 2018-07-11T17:19:22.460

Reputation: 266