Synchronizing files with Unison
First, the system environment
192.168.1.2:
# uname-alinux S2 2.6.18-128.el5 #1 SMP Wed Dec 11:42:39 EST. i686 i686 i386 Gnu/linux
# LSB_RELEASE-ALSB Version:: Core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarchdistributor ID: # Redhatenterpriseserverdescription: #Red Hat Enterprise Linux Server Release 5.3 (Tikanga) Release:5.3codename:tik Anga
#已安装etags
192.168.1.23
# uname-alinux Localhost.localdomain 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 03:15:09 UTC-x86_64 x86_64 x86_64 GNU/L Inux
[Email protected] 2.61]# lsb_release-alsb Version:: Base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch: Graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarchdistributor id:centosdescription: CentOS Release 6.5 (Final) release:6.5codename:final
#未安装etags, install with Yum
You have configured a dual-machine SSH trust. (Omit configuration process)
Second, installation ocaml-3.10.2
# tar ZXVF ocaml-3.10.2.tar.gz # cd ocaml-3.10.2# #需删除man1, or error # rm-rf/usr/local/man/man1#./configure # make Word opt# Make install
Third, installation unison-2.32.52
# tar zxvf unison-2.32.52.tar.gz# cd unison-2.32.52# make Uistyle=text threads=true static=true# CP Unison/usr/local/bin /
Iv. Testing Connectivity
# unison/ssh://192.168.1.23/-testserver
V. Examples
# Vim/root/.unison/1.2_ftp.prf#2016-05-17#back up/var/ftp/pub to 192.168.1.23:/home/databack/1.2_ftp root =/var/ftp/ Pub#root =/tmp/unison2root = Ssh://[email Protected]//home/databack/1.2_ftpforce =/var/ftp/pub#force =/tmp/ Unison2batch = Truemaxthreads = 100#repeat = 10retry = 3owner = Truegroup = Truetimes = trueperms = -1fastcheck = Falsersy NC = Falsesshargs =-cxferbycopying = Trueconfirmbigdel = Falselog = Truelogfile =/root/.unison/1.2_ftp.log
# # Default read config file directory:/root/.unison or ~/.unison
#/usr/local/bin/unison 1.2_ftp
Six, unison parameter detailed (network)
-testserver
Test connectivity, and the connection to the server exits. Example:
# Unison/ssh://[email protected]/-servercmd=/usr/local/bin/unison-testserver
If the server-side unison executable is not in the default directory, even if there is no unison command (you need to compile one to upload to the server), you need to use the-servercmd parameter to tell the server to execute Unison The command location.
using the-testserver parameter, the successful link exits, and does not perform subsequent operations such as directory comparisons.
-servercmd xxx
tell unison what the server-side unison command is. See the example above.
-auto
Accept the default action and wait for the user to confirm that it is executed.
-batch
batch mode, automatic mode, accept the default action, and execute.
-ignore xxx
add xxx to the Ignore list
-ignorecase [True|false|default]
Ignore file name capitalization
-follow xxx
Whether to support synchronization of symbolic connections to content;
For example, in my ~/.unison configuration file default.prf, there are
# unison Preferences File Follow = path {unison_*} ignore = path {Wwwroot/wiki_mirror} ignore = Name {,.} *{.~ $lock} ignore = Name {a.out}
I will pre-synchronize the system files under XXX/SRC, respectively, as a symbolic link, such as unison_httpd.conf point to C:/Program files/apache/.../httpd.conf. When synchronizing, the "follow = Path {unison_*}" configuration (or parameter) will track the actual file that the symbolic link points to. If you do not have this setting, the symbolic links are not synchronized.
-immutable xxx
Constant directory, ignored when scanning
-silent
Quiet mode
-times
Synchronization modification Time
-path XXX Parameters
Synchronizes only the subdirectories and files specified by the-path parameter, not the entire directory. For example
Unison/home/username ssh://remotehost//home/username \-path shared \-path pub \-path. netscape/bookmarks.html
Synchronizing files with Unison