Unison file synchronizer




















Virtualization How to install open-vm-tools Open Virtual Machine Backup sync synchronize unison. Comments 3. Posted on May 29, Posted on October 1, Is the step 6 should be done in both the servers are only in Master.

Posted on October 2, Unison works between any pair of machines connected to the internet, typically communicating over ssh, but also directly over TCP.

It is careful with network bandwidth, and runs well over slow links such as PPP connections. Transfers of small updates to large files are optimized using a compression protocol similar to rsync. Unison is resilient to failure. It is careful to leave the replicas and its own private structures in a sensible state at all times, even in case of abnormal termination or communication failures. Note that only a very small number of people are actively working on maintaining unison.

An estimate is 2. This has a substantial impact on the handling of bug reports and enhancement reports; see below. Help in terms of high-quality bug reports, fixes, and proposed changes is very welcome. The Unison project provides Unison as source code.

Results from Continuous Integration builds, while performed for the purposes of testing, are available for use on a limited set of platforms.

Currently, this is probably less well explained than it should be. You may be able to find a pre-built binary for your operating system, version, and CPU type.

Generally, you should use the most recent formal release, currently 2. Earlier branches e. There are sometimes release candidates. There is always the master branch in git, which historically has been quite stable. Beware that Unison uses OCaml's built-in data marshalling, and that this facility is unstable across versions of "ocaml" the standard implementation of the OCaml language. Additionally, Unison has incompatible changes across minor releases e. Therefore, you must use the same Unison minor version built with the same ocaml version on all systems.

There are two mailinglists: unison-users and unison-hackers. The issue tracker is for bug reports and limited enhancement requests. Specifically, this means that questions and requests for help are not appropriate as issues; those should be directed to unison-users or unison-hackers if the discussion requires reading the source code.

Unison's product is the source code. A packaging system having an old version is not a bug in Unison. Here's one example: on my laptop, I move the file "widgets" from directory "foo" to the directory "bar.

However, "widgets" is still in "foo" on the desktop. The next time I run rsync with the desktop as the source and the laptop as the destination, "widgets" gets copied over from "foo" on the desktop back into "foo" on the laptop, leaving me with "widgets" in both "foo" and "bar," which produces a real mess.

Of course, I could run rsync with the "delete" flag set, so that files deleted on the source are also deleted on the destination, but that can be a very dangerous practice. What if I delete "foo" on the laptop but change "foo" on the desktop? If I run rsync with the laptop as source, then "foo" is deleted on the desktop, which is not what I want.

Instead, I have to remember to run rsync with the desktop as source so that the changed "foo" is copied over to the laptop. But what if there were files I changed on the laptop and deleted on the desktop? Then I need to run rsync with the laptop as source … and on and on, ad infinitum, back and forth. Unison solves this problem. You define a source and a destination, and then you run Unison.

After some length of time, Unison starts asking you questions about the files it has found: copy this file from laptop to desktop? Copy this other file from desktop to laptop? Delete this file on the laptop since it was deleted on the desktop? You can accept Unison's guesses, or specify a direction for the copy to go, or even tell Unison to skip the file entirely until another day.

With Unison, synchronizing two directories, each on a different machine, becomes a far simpler task. Unison has another trick up its sleeve that can come in handy.

My laptop is configured differently than my desktop, so I don't want to synchronize my KDE config files on both machines. Instead, I just want to backup my laptop's KDE config files to the desktop, and I always want the copy to go one way only: from laptop to desktop. If you're interested in backup for your files, you owe it to yourself to check out and learn Unison. Unison is easy to install; the tricky part comes when you need to configure it. Even then, Unison's basic configuration is a piece of cake.

It's defining exactly what you want to synchronize, and how, that will take up most of your time. It's not super-hard to create those definitions, but you definitely need to read carefully and test your setup before you start using Unison with your essential data. If you're using a Debian-based distribution, then installing Unison is easy as pie.

Just run "apt-get install unison unison-gtk" and you're done: you'll have both the basic, command line-only Unison program and the GTK-based GUI. To my knowledge, this is not the case with Red Hat and Fedora. Once you're there, click on the "Download" link at the top of the page. On the Download page, the developer asks you a couple of pretty innocuous questions. If you'd like to fill them in, do so, but you don't have to. Scroll down to the bottom of the page, and click on the appropriate button to download Unison.

I recommend choosing Download latest stable version , but if you're feeling particularly masochistic, go ahead and choose a different version. Just don't come crying to me when you have problems. After pressing the button, your Web browser will display a list of files.

To download the files you need, right-click and choose "Save Link to Disk" or somesuch language, and save the files to your hard drive. As of this writing, the latest stable version of Unison is 2. All told, it's about a 2. After you get the files on your machine, you have a small decision to make: who's going to be running Unison? If you're the only person who uses your computer, or you're the only person on your computer who will use Unison, then you can just make these files executable, put them where they can be found by your path, and you're ready to roll.

If you're going to allow several people to run Unison, then you need to put its files in a place where everyone can get to them, which will require root access. If you're going to run Unison on your own machine, or you want others who use the machine to have access to Unison, then here's the easiest thing to do. As root, cd into the directory containing the files you downloaded, and type the following:. If you don't have root access, then cd into the directory containing the downloaded Unison files and run the following you can skip the second step if you already have a bin subdirectory in your home directory :.

You just made the Unison files executable, created a bin subdirectory in your home directory, and moved the Unison programs into that subdirectory, which should be in your path already. As for the Unison manual you downloaded, place that where you can get to it as needed. It's very thorough and well worth the time you give to it. Otherwise, you can just start Unison from the command line.

Let's start with a simple example: you want to synchronize two folders on the same machine these could just as easily be two folders, one on your machine and one on another machine. Let's call these folders "poetryA" and "poetryB," but remember, our goal is to make sure that they hold the same files and subfolders.

In poetryA, let's create the following subdirectories:. Now let's set up Unison and get it running for the first time. Open Unison, and you're presented with a list of "profiles": information about a specific set of files and folders that you wish to synchronize. In your case, you shouldn't have any, so we're going to have to create one. Unison's list of profiles. Since we don't have any to start with, go ahead and press Create new profile to get the process started.

Give your new Unison profile a useful name. Since we're synchronizing a folder of poetry, let's be really clever and give this profile the name of … you guessed it, Poetry! Press OK , and you are next asked to name your first root. Identify the first directory that you wish to synchronize using Unison.

A "root," in Unison-speak, is the directory that you wish to synchronize. When you choose a root, you are telling Unison that you wish to sync the directory and all of its contents—files and subdirectories—unless otherwise stated. To make the process easy, just click on the Browse button and navigate to the poetryA folder. In my case, it's on my desktop. Once you've made your choice, press OK to close the "Select a local directory" window and then press Continue in the "Root selection" window to move on to the next step.

Now it's time to select your second root, the directory that you want to synchronize with the first root. Identify the second directory that you want to synchronize using Unison.

Choose the second root the same way you chose the first one, by clicking on Browse and following the logical steps. Notice, however, that you must make an additional choice in this window: the type of method you will you use to communicate between the two roots.

In our case, since the two directories are on the same machine, we'll use Local. Make sure that it is chosen, and press Continue. Unison's warning the first time it is run. This is the first time we've ever run Unison, so it has to take some time and figure out just what files and folders it's going to have to deal with.

Unison is warning you that it will now have to go through both roots and build a list of all the files it finds. This list, called an "archive" by Unison, will be used in the future when you wish to perform another synchronization. If you have a lot of content in your roots, this process can take quite a while—in some cases, hours. Since we have only a few poems in our "poetryA" folder, it's going to take only seconds. But be prepared to go make yourself a cup of coffee or spend some time reading email if you have thousands of files.

Press OK to acknowledge Unison's warning, and shortly afterward you should see Unison's comparison of "poetryA" and "poetryB. Comparing two roots using Unison. If you look at Unison's window, it should make sense.

Unison has found four directories in "poetryA" and none in "poetryB. Since that is what we want, press the Go button and watch as Unison does its work. If you're not sure about a particular file or directory, click once on the line for it so it's selected, and then view the message in the bottom pane of the window. In this case, Unison is telling us there is a directory named "Hardy" in "poetryA" that is missing in "poetryB.

Results of a synchronization using Unison. As you can see, Unison has now placed green checkmarks in the Status column to indicate a successful synchronization. If you were to look in the "poetryB" folder now, you'd see the same folders and files that are in "poetryA," proof that Unison did its job. Things are going well …. Boy, I've really messed things up.

I had two folders perfectly in sync, and now I've gone and deleted some things in one place, changed things in other places, and added things in still other places.

Worse, I've altered the same file, but in different ways in different folders. Ay yi yi. If I were going to sort this out manually, it would take some time, even with the small number of files I'm using in this example. Worse, it would be tedious, and there is nothing worse than a tedious task. Unison to the rescue! Open Unison, and notice that Poetry is listed as a profile. Select it and then click on OK to start comparing the two roots.



0コメント

  • 1000 / 1000