Unison and directory changes
I love Unison. It’s open-source, it’s cross-platform compatible, it’s reasonably fast, it never ever destroyed my data, it has just enough verbosity to make it practical, and it’s even more intelligent than rsync. It even occasionally detects when a folder name has changed (instead of deleting the mirrored folder and copying everything over again). Long story short - I use it for all my backup requirements.
However, there is one crucial problem (two actually, but changing drive names are definitely Windows’ fault - and since I mounted every single drive into designated folders, everything’s okay). As I said, the problem:
If you have a carefully crafted Unison backup profile, and you change anything (name or location) about one of the source folders, Unison will present you with two options. Either you’ll get a proper warning that it doesn’t know this folder, or it’ll think one of the two folders is just empty (and delete everything in the other one, if you aren’t wary).
What if you just discovered that your massive movie folder doesn’t fit on your drive any more, but you’d like to: 1. keep it in one piece, 2. keep it in the backup routine and 3. not do all the hour-long indexing-crap all over again? Apparently, you can find the preference files for each profile, and it may be possible to convince Unison with a so-called rootalias that one of its folders have changed. However, I’ve literally tried every possible syntax combination for this property, and it just doesn’t work as advertised.
So, the easy solution is to create a hardlink. Just pretend to Unison that the folder is still there, and it’ll run just as well as before. The command on Windows would be mklink -j (don’t try to use D, because that’s a symlink), and the Windows calls these junctions. Of course, this solution is quite near to cheating, and will break in quite a few (predictable) circumstances, but it works just fine because Unison is oblivious to hardlinks. If you figure out how to set the rootalias correctly, I’m open for suggestions.