LSYNCD on which server to start, this server is like when the server is synchronized, other servers if more files will be deleted, fewer files will be synchronized from this server.
Modifying the contents of the file will also be synchronized
Rsync can achieve synchronization/backup of files, install configuration step to Linux under rsync Backup/Sync files
LSYNCD implementation of trigger or timed notification events, can be near real-time synchronization files (encapsulated rsync), GitHub address: HTTPS://GITHUB.COM/AXKIBE/LSYNCD
System: centos6.4
Home server: 192.168.1.136
Sync Server: 192.168.1.137
Install the LSYNCD on the 192.168.1.136
Installation Dependencies (Lsyncd written in the Lua language)
[plain] view plain copy print? Yum Install Lua Lua-devel
Download Lsyncd-master.zip on GitHub
[plain] view plain copy print? Unzip Lsyncd-master.zip CD Lsyncd-master CMAKE-DCMAKE_INSTALL_PREFIX=/USR/LOCAL/LSYNCD make && make instal L
Creating a configuration file
[plain] view plain copy print? Cd/usr/local/lsyncd/mkdir./etc mkdir./var VI etc/lsyncd.conf
The content is (--is the annotation character in Lua)
[Plain] View plain copy print? -- Global configuration settings { -- log file storage location logfile = "/usr/local/lsyncd/var/lsyncd.log", -- Status file storage location statusfile = "/usr/local/lsyncd/var/ Lsyncd.status ", -- writes the LSYNCD state to the Statusfile interval above, default 10 seconds --statusInterval = 10 -- whether to enable daemon mode, default true --nodaemon=true -- inotify Monitored event  , default is closewrite, can also be Modify or closewrite or modify inotifyMode = "Closewrite", -- max sync process maxprocesses = 8, --Cumulative to how many events are monitored to activate one synchronization, Even after the delay delay time has not yet been --maxDelays = 1 } -- Remote directory synchronization sync { -- rsync , rsyncssh , direct Three models default.rsync, -- Sync source directory, using absolute path. source = "/home/wwwroot/attachments", -- define the destination address. There are several ways to do this, using remote sync addresses, addresses in rsync target = "RSYNC137@192.168.1.137::RSYNCD", -- Default true , allowing synchronous deletion. There are false, startup, running values --delete = true, -- which files are different steps exclude = { ". *" }, -- Cumulative events, waiting for rsync synchronization delay time, default 15 seconds, maximum cumulative to 1000 non-merged events (1000 file changes), delay = 15,