LeLe
 
Copyright NOTICE: You can reprint, reprint, please be sure to text form the original source of the article and author information and this statement.
 
Objective
 
Rsync is a data mirroring and Backup tool under the Linux,unix system, have the ability to make local and remote host files, directories, fast synchronous mirroring, remote data backup and so on. During synchronization, you can delete or update the local machine data according to the data changes on the remote server. Synchronizing data does not have to be delivered in full, greatly increasing the speed of synchronizing and backing up files. Also, in the context of network security, it can be set to SSH transmission mode. Remote host (rsync Server) for rsync daemon mode, opened will be open TCP4 873 port, waiting for the local host (rsync client) connection, the connection when the remote host to authenticate, to confirm the entry of legitimate users, began to carry out data transmission, The entire data is backed up to the local host on the first transmission, and when the next transmission is added, the corresponding parameters can be adjusted according to the data changes of the remote host. This article is just a simple application of RSYNC software operation documents, mainly for beginners a preliminary introduction, if you are in the application, what better advice and suggestions, please mail me. I will continue to update this document, thank you! :)
 
Software and Platform
 
FreeBSD 5.2 (Server and Client)
 
Server ip:172.18.5.251 hostname:freebsd-1
 
Client ip:172.18.5.247 hostname:freebsd-2
 
apache_1.3.29
 
rsync-2.5.7
 
Objective
 
Back up all content under the/usr/local/www/data-dist directory on the rsync Server (172.18.5.251) to/backup/www under Rsync Client (172.18.5.247)
 
Installation and Configuration
 
One, Rsync Server
 
Step 1: Install
 
freebsd-1#cd /usr/ports/net/rsync
 freebsd-1#make install clean
 
Step 3: Configure rsyncd.conf
 
freebsd-1#vi /usr/local/etc/rsyncd.conf //加入以下内容
 [www]
 comment = web server backup
 path = /usr/local/www/data-dist
 auth users = tonny
 uid = nobody
 gid = nogroup
 secrets file = /usr/local/etc/rsyncd.secrets
 read only = no
 
Step 4: Configure Rsyncd.secrets
 
freebsd-1#vi /usr/local/etc/rsyncd.secrets //加入以下内容
 tonny:123456 // 认证所需的用户名/密码
 freebsd-1#chmod 600 rsyncd.secrets
 
Step 5: Configure rc.conf
 
freebsd-1#vi /etc/rc.conf //加入以下内容
 rsyncd_enable="YES"
 
Step 6: Start Rsync daemon mode