Use Unison to synchronize files on Ubuntu/Debian

Source: Internet
Author: User

Unison is a free and cross-platform file synchronization tool. With it, we can save two sets of file copies (instances) on two different platforms, or save it on different disks of the same system. Unlike a simple image method or backup utility, Unison can update two copies of the distributed directory structure at the same time. It can detect and display conflicting updates. Unlike distributed file systems, Unison is a user-level program. You do not need to change the kernel or have root user permissions on any host.

Unison can be used between any one of the machines connected to the Internet by directly connecting to the layer link or a tunnel connected Based on encrypted SSH. It uses network bandwidth with caution and can be used smoothly on slow links such as PPP connections. You can use a compression protocol similar to rsync to optimize the transfer of Small-capacity updates to large files.

Debian uses Unison to synchronize files in two directions

Enable two-way file synchronization in CentOS 5.5 using Unison

Installation and configuration of two-way synchronous software Unison

Use Unison to implement two-way synchronous Image

In this practical article, I used two systems running Ubuntu. The local system runs the Ubuntu Desktop version with the IP address 192.168.1.100/24, while the remote system runs the Ubuntu server version with the IP address 192.168.1.201/24. I also want to synchronize the/home/sk/Unixmen directory between the two systems. Change the value according to your actual situation.

Install Unison

Install on local and remote server systems:

Use the following two commands to update and upgrade these two systems:

Sudo apt-get update sudo apt-get upgrade

Install Unison on both systems.

Sudo apt-get install unison-gtk

Configuration

Now, on your local system, start the Unison GUI tool from Menu or Dash. Its interface should look as follows.

First, we have to create a new configuration file for the synchronization process. Click Add to create a new configuration file. Click Forward ).

Enter the name of the new configuration file and click Forward ).

You are required to select the synchronization method. I want to use SSH to synchronize files between a local desktop and a remote server. So here I select Using SSH (Using SSH) from the Synchronization Kind drop-down box ). Enter the IP address and User Name of the remote host server, as shown in the following figure, and click Forward (next ).

Now, we need to specify the local folder and remote folder to be copied. In the Local Directory box, enter the path of the Local folder (for example,/home/sk/Unixmen in this article), in the Remote Directory (Remote Directory) enter the path of the remote folder. Click Forward ).

If you want to synchronize any folders in the FAT Partition, check the FAT Partition (FAT) Partition and click Forward (next ).

  • 1
  • 2
  • Next Page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.