{"id":13369,"date":"2019-04-01T22:27:28","date_gmt":"2019-04-01T22:27:28","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=13369"},"modified":"2019-04-01T22:27:28","modified_gmt":"2019-04-01T22:27:28","slug":"unison-an-ultimate-local-remote-file-synchronization-tool-for-linux","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/01\/unison-an-ultimate-local-remote-file-synchronization-tool-for-linux\/","title":{"rendered":"Unison \u2013 An Ultimate Local\/Remote File Synchronization Tool for Linux"},"content":{"rendered":"<p><strong>File Synchronization<\/strong>\u00a0is the process of mirroring, files and data in two or more locations in accordance with certain protocols. Files and Data are the most valuable thing in this era of Information Technology. By File Synchronization, we ensure that one or more copies of our priceless data is always available in case of disaster of any kind or when we need to work in many locations.<\/p>\n<p>A good File Synchronizer is supposed to have below listed Features:<\/p>\n<ol>\n<li>Cryptographic synchronisation, as a security Implementation.<\/li>\n<li>A good ratio data compression.<\/li>\n<li>A Perfect algorithm implementation to check data duplication.<\/li>\n<li>Keep track of file source change.<\/li>\n<li>Scheduled Synchronisation.<\/li>\n<\/ol>\n<p>One such tool is\u00a0<strong>Unison<\/strong>. Here in this article we will be discussing \u201c<strong>Unison<\/strong>\u201d in details, along with its features, functionality and a lot more.<\/p>\n<h3>What is Unison?<\/h3>\n<p><strong>Unison<\/strong>\u00a0is a cross platform file synchronization application which is useful in synchronizing data between two or more locations be it computers or storage device.<\/p>\n<h4>Features of Unison<\/h4>\n<ol>\n<li>Released under General Public License (GPL)<\/li>\n<li>Open Source and Cross Platform Available for (Linux, Unix, BSD, Windows, Mac)<\/li>\n<li>Make available same version of file across different machine, regardless of last modified location.<\/li>\n<li>Cross Platform Synchronization possible i.e., a Windows machine can be synchronized over a *nix Server.<\/li>\n<li>Communicate over standard Protocol TCP\/IP i.e., possible between any two machines over internet regardless of Geographical Location.<\/li>\n<li>Smart Management \u2013 Show conflict when a file has been modified on both source and show it to the user.<\/li>\n<li>Secured SSH Connection \u2013 An encrypted data transfer.<\/li>\n<li>rsync algorithm is deployed here, only the modified part is transferred and overwritten. Hence. it\u2019s fast in execution and Maintenance.<\/li>\n<li>Robust in nature<\/li>\n<li>Written in \u201cObjective Caml\u201d programming Language.<\/li>\n<li>Matured and Stable, no active development required.<\/li>\n<li>It is a user-level program ie., Application don\u2019t need superuser privileged.<\/li>\n<li>It is known for its clear and precise specification.<\/li>\n<\/ol>\n<h3>Installation of Unison in Linux<\/h3>\n<p>The current stable release (<strong>Unison-2.40.102<\/strong>) can be downloaded from the link below:<\/p>\n<p><a href=\"https:\/\/www.seas.upenn.edu\/~bcpierce\/unison\/\/download\/releases\/stable\/\" target=\"_blank\" rel=\"nofollow noopener\">Download Unison 2.40.102 Stable<\/a><\/p>\n<p>Alternatively, we can also download and Install \u201c<strong>Unison<\/strong>\u201d, if it is available in repo using\u00a0<strong>apt<\/strong>\u00a0or\u00a0<strong>yum<\/strong>\u00a0command as shown below.<\/p>\n<h5>On Debian\/Ubuntu\/Linux Mint<\/h5>\n<p>Open terminal using \u201c<strong>Ctr+Alt+T<\/strong>\u201d and run the following command on the terminal.<\/p>\n<pre>$ sudo apt-get install unison<\/pre>\n<h5>On RHEL\/CentOS\/Fedora<\/h5>\n<p>First, enable\u00a0<a href=\"https:\/\/www.tecmint.com\/how-to-enable-epel-repository-for-rhel-centos-6-5\/\" target=\"_blank\" rel=\"noopener\">EPEL repository<\/a>\u00a0and then install using the following command.<\/p>\n<pre>$ sudo yum install unison<\/pre>\n<p><strong>NOTE<\/strong>: The above command will Install Unison without\u00a0<strong>GUI<\/strong>. If you need to Install Unison with GUI support, install \u2018<strong>unison-gtk<\/strong>\u2018 package (Only available for\u00a0<strong>Debian<\/strong>\u00a0based distros) using the below command.<\/p>\n<pre># apt-get install unison-gtk<\/pre>\n<h3>How to Use Unison<\/h3>\n<p>Unison is used to synchronize a set of files in a directory tree to another location with similar structure, which may be a local host or remote host.<\/p>\n<h4>Local File Synchronization<\/h4>\n<p>Let\u2019s<strong>\u00a0create 5<\/strong>\u00a0files under your Desktop and then synchronize it to a folder called \u2018<strong>desk-back<\/strong>\u2018 in your home directory.<\/p>\n<pre>$ cd Desktop\/\r\n$ touch 1.txt 2.txt 3.txt 4.txt 5.txt<\/pre>\n<pre>$ ls\r\n\r\n1.txt 2.txt 3.txt 4.txt 5.txt<\/pre>\n<pre>$ mkdir \/home\/server\/desk-back<\/pre>\n<p>Now run the \u2018<strong>unison<\/strong>\u2018 command to synchronize your Desktop files to under \u2018<strong>desk-back<\/strong>\u2018 in your home directory.<\/p>\n<pre>$ unison \/home\/server\/Desktop \/home\/server\/desk-back\/<\/pre>\n<h5>Sample Output<\/h5>\n<pre>Contacting server...\r\nLooking for changes\r\nWarning: No archive files were found for these roots, whose canonical names are:\r\n\/home\/server\/Desktop\r\n\/home\/server\/desk-back\r\nThis can happen either\r\nbecause this is the first time you have synchronized these roots,\r\nor because you have upgraded Unison to a new version with a different\r\narchive format.\r\nUpdate detection may take a while on this run if the replicas are\r\nlarge.\r\nUnison will assume that the 'last synchronized state' of both replicas\r\nwas completely empty. This means that any files that are different\r\nwill be reported as conflicts, and any files that exist only on one\r\nreplica will be judged as new and propagated to the other replica.\r\nIf the two replicas are identical, then no changes will be reported.If you see this message repeatedly, it may be because one of your machines\r\nis getting its address from DHCP, which is causing its host name to change\r\nbetween synchronizations. See the documentation for the UNISONLOCALHOSTNAME\r\nenvironment variable for advice on how to correct this.\r\nDonations to the Unison project are gratefully accepted:\r\nhttp:\/\/www.cis.upenn.edu\/~bcpierce\/unison\r\nPress return to continue.[]\r\n...\r\n...\r\nSaving synchronizer state\r\nSynchronization complete at 13:52:15 (5 items transferred, 0 skipped, 0 failed)<\/pre>\n<p>Now check the location\u00a0<strong>\/home\/server\/desk-back<\/strong>, if the synchronization process was successful?<\/p>\n<pre>$ cd \/home\/server\/desk-back\/\r\n$ ls\r\n\r\n1.txt 2.txt 3.txt 4.txt 5.txt<\/pre>\n<h4>Remote File Synchronization<\/h4>\n<p>For remote file synchronization, you must have same version of Unison installed on both local and remote server. Run the following command to verify that the local unison can start and connect to the remote unison server.<\/p>\n<pre>$ unison -testServer \/home\/ravisaive\/Desktop\/ ssh:\/\/172.16.25.125\/\/home\/ravisaive\/Desktop\/<\/pre>\n<h5>Sample Output<\/h5>\n<pre>Contacting server...\r\nravisaive@172.16.25.125's password: \r\nConnected [\/\/tecmint\/\/home\/ravisaive\/Desktop -&gt; \/\/tecmint\/\/home\/ravisaive\/Desktop]<\/pre>\n<p>The above results, indicates that the remote server is connected successfully, now sync the files using below command.<\/p>\n<pre>$ unison -batch \/home\/ravisaive\/Desktop\/ ssh:\/\/172.16.25.125\/\/home\/ravisaive\/Desktop\/<\/pre>\n<h4>Executing GUI Unison<\/h4>\n<p>The first step is to set profile which requires you to set basic information as name of a profile and what you want to synchronize, source and Destination location, etc.<\/p>\n<p>To start Unison GUI, run the following command on the terminal.<\/p>\n<pre>$ unison-gtk<\/pre>\n<div id=\"attachment_5866\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/1.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5866\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/1-620x350.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/1-620x350.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/1-1024x578.jpeg 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/1.jpeg 1360w\" alt=\"Create New Unison Profile\" width=\"620\" height=\"350\" aria-describedby=\"caption-attachment-5866\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5866\" class=\"wp-caption-text\">Create New Profile<\/p>\n<\/div>\n<div id=\"attachment_5868\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/2.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5868\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/2-620x350.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/2-620x350.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/2-1024x578.jpeg 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/2.jpeg 1360w\" alt=\"Enter Unison Profile Description\" width=\"620\" height=\"350\" aria-describedby=\"caption-attachment-5868\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5868\" class=\"wp-caption-text\">Enter Profile Description<\/p>\n<\/div>\n<div id=\"attachment_5869\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/3.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5869\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/3-620x350.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/3-620x350.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/3-1024x578.jpeg 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/3.jpeg 1360w\" alt=\"Select Unison Synchronization Type\" width=\"620\" height=\"350\" aria-describedby=\"caption-attachment-5869\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5869\" class=\"wp-caption-text\">Select Sync Type<\/p>\n<\/div>\n<div id=\"attachment_5870\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/4.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5870\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/4-620x350.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/4-620x350.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/4-1024x578.jpeg 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/4.jpeg 1360w\" alt=\"Select Sync Directories\" width=\"620\" height=\"350\" aria-describedby=\"caption-attachment-5870\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5870\" class=\"wp-caption-text\">Select Sync Directories<\/p>\n<\/div>\n<div id=\"attachment_5871\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/5.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5871\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/5-620x350.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/5-620x350.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/5-1024x578.jpeg 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/5.jpeg 1360w\" alt=\"5elect Partition Type\" width=\"620\" height=\"350\" aria-describedby=\"caption-attachment-5871\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5871\" class=\"wp-caption-text\">5elect Partition Type<\/p>\n<\/div>\n<div id=\"attachment_5872\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/6.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5872\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/6-620x350.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/6-620x350.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/6-1024x578.jpeg 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/6.jpeg 1360w\" alt=\"Unison Profile Created\" width=\"620\" height=\"350\" aria-describedby=\"caption-attachment-5872\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5872\" class=\"wp-caption-text\">New Profile Created<\/p>\n<\/div>\n<div id=\"attachment_5873\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/7.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5873\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/7-620x350.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/7-620x350.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/7-1024x578.jpeg 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/7.jpeg 1360w\" alt=\"Select Created Profile\" width=\"620\" height=\"350\" aria-describedby=\"caption-attachment-5873\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5873\" class=\"wp-caption-text\">Select Created Profile<\/p>\n<\/div>\n<div id=\"attachment_5874\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/8.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5874\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/8-620x350.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/8-620x350.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/8-1024x578.jpeg 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/8.jpeg 1360w\" alt=\"Unison Sync Message\" width=\"620\" height=\"350\" aria-describedby=\"caption-attachment-5874\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5874\" class=\"wp-caption-text\">Unison Sync Message<\/p>\n<\/div>\n<p>Once profile is created and source as well as destination is entered, we are welcomed with the below window.<\/p>\n<div id=\"attachment_5875\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/9.jpeg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-5875\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/9-620x350.jpeg\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/9-620x350.jpeg 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/9-1024x578.jpeg 1024w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/03\/9.jpeg 1360w\" alt=\"Unison Flle Synchronization Process\" width=\"620\" height=\"350\" aria-describedby=\"caption-attachment-5875\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-5875\" class=\"wp-caption-text\">File Synchronization Process<\/p>\n<\/div>\n<p>Just select all the files and click on\u00a0<strong>OK<\/strong>. The files will start synchronising from both the directions, based upon last update time stamp.<\/p>\n<h3>Conclusion<\/h3>\n<p><strong>Unison<\/strong>\u00a0is a wonderful tool which makes it possible to have custom synchronisation either way (Bidirectional), available in GUI as well as command Line Utility. Unison provides what it promises. This tool is very easy to use and requires no extra effort. As a tester I was very much impressed with this application. It has a whole lot of features which can be implemented as required. For more information read\u00a0<a href=\"https:\/\/www.cis.upenn.edu\/~bcpierce\/unison\/download\/releases\/stable\/unison-manual.html\" target=\"_blank\" rel=\"nofollow noopener\">unison-manual<\/a>.<\/p>\n<p><strong>Read Also<\/strong>:<\/p>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/rsync-local-remote-file-synchronization-commands\/\" target=\"_blank\" rel=\"noopener\">Rsync (Remote Sync) of Files<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/rsnapshot-a-file-system-backup-utility-for-linux\/\" target=\"_blank\" rel=\"noopener\">Rsnapshot (Rsync Based) File Synchronizer<\/a><\/li>\n<\/ol>\n<p>That\u2019s all for now. I\u2019ll soon be here again with another interesting article. Till then stay tuned and connected to\u00a0<strong>Tecmint<\/strong>. Don\u2019t forget to provide us with your valuable feedback in our comment section.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/file-synchronization-in-linux-using-unison\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>File Synchronization\u00a0is the process of mirroring, files and data in two or more locations in accordance with certain protocols. Files and Data are the most valuable thing in this era of Information Technology. By File Synchronization, we ensure that one or more copies of our priceless data is always available in case of disaster of &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/01\/unison-an-ultimate-local-remote-file-synchronization-tool-for-linux\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Unison \u2013 An Ultimate Local\/Remote File Synchronization Tool for Linux&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-13369","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13369","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=13369"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13369\/revisions"}],"predecessor-version":[{"id":13370,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13369\/revisions\/13370"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=13369"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=13369"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=13369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}