I will be using pushchanges and pushall no more! I found Unison, and my troubles are lifted. Unison is a great little app that hooks up a local folder with a remote folder via SSH. Since it runs on both machines as a user-level application, there’s no need for changing kernels and no lag from trying to scan a remote filesystem. However, you get the same effect that you’d have from an NFS or SSHFS mount. Changes take about a second to propagate between the two systems, but that’s pretty forgivable, since it happens in the background and only uses the network bandwidth that it actually needs to.
I did run into a few caveats with it:
- You have to install it on both machines, and it has to be the same version on both machines. Since my yahoo BSD machine could only find version 1.16, that was what I had to install on the mac.
- Read the command-line options, and use them. The UI is pretty nice, but without the -repeat option, it’s pretty much useless.
- Older versions are a bit flaky, especially when it comes to symbolic links. Make sure that you carefully set the -ignore flags to avoid any symlinks in your sync folders. (Frequent use of gmake-symlink is a big culprit.)
- If it dies on an error, it might corrupt the archive. Delete the archive on both machines, and try again. (Archive files are in ~/.unison/ and start with “ar”.)
- The mac puts its unison stuff in ~/Library/Application Support/Unison/. Do
ln -s "~/Library/Application Support/Unison" ~/.unisonand you’ll save yourself a lot of remembering.
- Sometimes, it’ll hit some file that makes it barf. I don’t know why. In my case, it was “Rate.php”. I just deleted the offending folders on both machines, and it ran fine. Then, while it was running in -repeat mode, I checked out the folders, on one machine and it synced them without any hiccups. Don’t know why, but it works.
- Changing the .prf file in ~/.unison/ and running from the command line is a lot faster than loading up the GUI each time and changing the text fields.
The error message that I saw most often was
Uncaught exception Invalid_argument("String.sub"). Once that showed up, I’d get disconnected from the server, and had to delete the archive and try again. The -debug option is handy for figuring out what’s going on.
I’m still mounting my home folder from my BSD box onto my mac. But I curse at my slow-as-dirt VPN connection a lot less now that I’m editing code files locally and only transferring the changes without any effort on my part.