0

I'd like to keep a common synchronized folder on two laptops. (With lots of media files and such, so can't use git, but on the other hand, very few changes needing reconciled.)

The easiest way to do this seems to be to keep a copy of the folder on each computer, and on an external hard drive, which can be plugged into either of them.

To sync them, I'd like to use unison.

This is working well, except that I repeatedly get the error message:

No archive files were found for these roots, etc

So that unison rescans everything from scratch, which takes ages

However when it does rescan completely, it always seems to do the right thing.

I presume I'm doing something wrong. Is this a possible thing to do with unison, and what do I need to frig to get it to recognise that this is one external drive and two local folders, and behave appropriately?

1 Answer 1

2

Unison archive files are stored in ~/.unison/ar* and are named after a hash of both absolute paths you synchronize (can be seen in text form inside the file itself). You need to make sure the external disk is always mounted at the same location.

Importantly, the paths include hostnames (to help with synchronizing over SSH), so if the computer's hostname changes e.g. due to DHCP assigning a new one, all old archive files will become no longer recognized.

In any case, investigate why the archive files are missing, and/or keep changing their names. Though they're binary, you can still run head or strings to see the textual header which shows both paths for every archive file.

3
  • Ah, so probably the problem is that the hostname associated with the external drive keeps changing, since it can be plugged into either computer. Any way to override that? Commented Jul 1, 2019 at 20:45
  • External drives don't have a hostname associated. It's your current OS hostname that's stored. Commented Jul 1, 2019 at 20:53
  • Ahh, I think I understand the problem now! Thank you for giving me the vital clue!! Commented Jul 1, 2019 at 21:25

You must log in to answer this question.

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