Lysncd是lua语言封装了 inotify 和 rsync 工具,采用了 linux 内核(2.6.13 及以后)里的 inotify 触发机制,通过inotify或者fsevents监控本地目录的变化事件,然后通过rsync同步。Lsyncd最强大之处在于简单高效传输海量数据并且Lsyncd支持多种工作模式。
安装rsync
[root@localhost ~]# yum install -y rsync
[root@localhost ~]# rsync --version
rsync version 3.1.2 protocol version 31
Copyright (C) 1996-2015 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
append, ACLs, xattrs, iconv, symtimes, prealloc
rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you
are welcome to redistribute it under certain conditions. See the GNU
General Public Licence for details.