If you have not set up key-based SSH authentication for the remote host, Unison will ask you to log in to the remote host via SSH before performing file sync. If there are multiple Unison profiles (e.g., sync1.prf, sync2.prf) in Unison directory, you can specify the profile name as follows. Once a Unison profile has been created on both servers, simply run Unison from either server. Socket://remote_host:port_num/relative/path/to/root Socket: socket://remote_host:port_num//absolute/path/to/root Root = rsh:// _host/relative/path/to/root RSH: root = rsh:// _host//absolute/path/to/root Root = ssh:// _host/relative/path/to/root So you can specify the root directory on a remote host by using one of the formats below: SSH: root = ssh:// _host//absolute/path/to/root Unison supports SSH, RSH or socket to sync files over network. The most important information in the above are the two root directories to sync. # If you want to ignore difference in file props: # Optionally, you can ignore specific files or directories that are matched with regular expressions. # Optionally, you can sync specific sub directories only (under the root). # If you don't want to be prompted, and just accept Unison's recommendation: # If you want Unison to run without any user input, try "batch" mode. # If you want one-way mirroring from one replica to the other, specify the source replica using "force" as follows. The following snippet is a Unison profile example. If UNISON variable is not defined, Unison looks for profiles in $HOME/.unison directory by default. You can create a Unison profile anywhere in your system, in which case you must define UNISON environment variable pointing to the directory path to the profile. prf extension) that specifies file sync settings such as directory roots, include/ignore paths or patterns, etc. The first thing to do is to create a Unison profile on both servers which have replicas to sync. Install Unison on Linux For Ubuntu, Debian or Linux Mint: $ sudo apt-get install unisonįor Fedora, CentOS or RHEL: $ sudo yum install unison In this tutorial, I will describe how to synchronize files between two servers with Unison command-line utility. In Linux, Unison is available as a command-line tool as well as a GUI program with GTK+ interface. Unison is available on multiple platforms including Linux, FreeBSD, Windows and MacOS X. Unison is an open-source file synchronization tool that natively supports bi-directional file synchronization. However, these tools are meant for uni-directional file sync (i.e., pushing or pulling incremental updates in one direction), and so two-way sync would require running such tools twice, one for each direction. There are several file mirroring tools on Linux, such as rsync or duplicati. The two replicas are then modified independently, and you want whatever changes made in one replica to be propagated to the other, so that both replicas remain in sync. Suppose you have a collection of files which are replicated on two different servers. How to synchronize files between two servers bidirectionally
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |