Preference files are the sanest way to use unison. In addition, preference files can be written to draw on a common file, making the creation of new preference files extremely easy. Often, no options need to be added to the command at all. Moreover, the only options you need to add are ones that affect the command's operation, which usually reduces the number of options to add. Instead, the structure becomes: unison PREFERENCE-FILE However, once a preference file is debugged, no root needs to be specified at the prompt. To further simplify matters, options share identical or at least similar names with the fields in a preference file. All unison's options are prefixed by a single hyphen, with a name that is usually self-explanatory – a useful feature when dealing with so many options. This basic structure is rapidly complicated by options. Scroll past the warning to attempt the synchronization.
#Unison file synch archive#
The resulting output can have three parts:Ī standard warning: This warning indicates that this is the first time you have run a synchronization or that archive files do not exist ( Figure 1). Similarly, any file that exists only in one directory will be copied to the other. Synchronization is two-way: The most recent version of a file in either directory will overwrite the version in the other. The basic command structure is: unison PATH1 PATH2 Its only drawback is that, if you are syncing in separate machines, each must have the same version of unison installed. It works with two sets of directories and files, updating one so that the two sets match. Unison is a shell for the rsync protocol it also calls upon external programs like ssh and diff for its operations.
Yet once preference files are created, the number of on-the-fly options is greatly reduced, and unison becomes a handy tool for file syncing, backups, and even merging files.
#Unison file synch how to#
So far as I can see, the only distribution that mentions how to simplify the use of unison with preference files is Arch Linux, and even it is incomplete – as is the original documentation that Arch references. In the absence of man or info files or usage instructions from the creators, the existing help focuses on building a command to use at the prompt – and, considering that unison has 88 options, that is not a very attractive option, even without a command history, especially if you have several sets of files with which you regularly work. For another, unison's documentation is maddeningly incomplete.
For one thing, rsync and ssh tend to be the default commands for file syncing. Although unison has been around for years, chances are you have never heard of unison.