1. Full name : Remote rynchronuzation
website address : http://www.samba.org/ftp/rsync/rsync.html
rsync Introduction : open source, fast, multi-functional, can achieve full-scale and incremental local or remote data synchronous backup of excellent, rsync software for UNIX, Linux, Windows and other operating system platform;
features : SCP features: full-volume copy;
rsync Incremental Copy (default unencrypted);
The full-volume and incremental replication data between different partitions or directories of the local host;
The ability to delete files and directories can be realized;
support to copy special files and connection files, equipment, etc.;
Can exclude the specified file or directory synchronization data, the equivalent of packaging command tar exclusion function;
Can do to maintain the original file or directory permissions, time, soft \ Hard links, belong to the main \ group, and so on all the attributes do not change;
Can realize the incremental synchronization, not only synchronizing the changed data, so the transmission efficiency is high;
can use SCP\RSH\SSH, and other ways to coordinate the transfer of files (itself is not encrypted);
Can be implemented through the socket (remote mode) transfer of files and data;
Process transfer mode that supports anonymous or authenticated (no system users) enables easy and secure data backup and mirroring .
2. Working method:
1, a single host before the data transmission (CP);
2, direct local synchronization (CP full amount; Rsync increment)
#复制: rsync-avz/etc/yum//tmp
#删除: Create an empty directory; Rsync-r--delete ll//tmmp
Note that a slash is added to indicate what is in the directory, and the file cannot be processed;
3, the use of rcp,ssh and other channels to transmit data;
#rsync-avz-e "ssh-p"/etc/hosts [email Protected]:kong
3, Common parameters :-v verbose mode output;
-Z Compress during transfer to improve transfer efficiency
        -A archive mode, which means recursively transferring files and preserving file attributes, equals Rtopgdi
        -T hold file time information
-o Keep file owner information
-p Keep file permissions
        -G Keep file owner Information
        -P Show synchronization process and progress information during transfer
-d Keep device file properties
-l Keep Soft links
- Exclude exclude
--password-file=/etc/rsync.password Specifying a password file
General use-avz
4. configuration file/etc/rsyncd.conf
#默认无, you need to create it yourself.
UID = rsync #默认nobody
GID = Rsunc
Use chroot = no #安全参数: Encryption mode
Max Connections =200 #客户端同时连接数量
Timeout = #超时时间
PID file =/var/run/rsyncd.pid #进程pid编号文件
Lock file =/var/run/rsync.lock #锁文件
Log file =/var/log/rsyncd.log #日志文件
[Kong] #模块
Path=/kong/#module path, synchronizing directory: Chown-r Rsync.rsync/kong
Ignore = Errors #忽略错误
Read Only = Fales #只读为假 is readable and writable
List = False #列表不允许
Hosts allow =10.0.0.0/24 #允许的主机
Hosts denv = 0.0.0.0/32 #拒绝的
Auth users = Rsync_backup #虚拟用户
Secrets file =/etc/rsync.password #用户对应的密码文件
#启动: rsync--daemon
#端口873
5. user password file :
Client: Ensure software is available
echo "Kong (password)" >/etc/rsync.password #虚拟用户的密码
chmod 600/etc/rsync.password
Service side:
echo "Rsync_backup:kong" >/etc/rsync.password #虚拟用户名 Virtual user's password
chmod 600/etc/rsync.password
6. Boot from : echo "/usr/bin/rsync--daemon" >>/etc/rc.local
This article from "thinking More than technology" blog, declined reprint!
Rsync Service and use complete