3

I'm using my desktop and a single board cpu (Raspberry Pi 2 - 900 MHz) to sync two very large directories with large files. Often, the files are the same but the filenames are changed. Unison is suggested here for that purpose, which I've used to good effect for smaller directories / files.

However, waiting for the single board to hash the files takes a very long time.

Is it possible to pre-cache the hashes so that I could run it overnight periodically with cron?

My attempt:

# Roots of the synchronization
label = Precaches Media Server
auto = true
root = /media/Files
root = /media/Files

However, syncing against itself causing a locking issue

Contacting server...
Looking for changes
Fatal error: Warning: the archives are locked.
Miati
  • 3,150
  • 1
    What you might do is to make a second mount. First create (as an example) /media/Files2, then mount via sudo mount -o bind /mediaFiles /media/Files2, so now you have two mountpoints on the same device. In your configuration replace the second line by /media/Files2. Unison then sees two different folders with identical contents. – ridgy Feb 14 '17 at 18:03

1 Answers1

0

You can fool Unison by giving it two views of the same tree that it doesn't recognize as being the same tree, through a bind mount.

mkdir /media/Files-bind
bindfs -n /media/Files /media/Files-bind
unison /media/Files /media/Files-bind </dev/null

I'm not sure if it actually precomputes the hashes in a way that can be used for another pair of archives, but it will compute the hashes of the local files twice.

I suspect that the only good solution would be to patch Unison to add the functionality you want.