1、Server端

下载rsync-3.1.1pre2.tar.gz

# tar zxvf rsync-3.1.1pre2.tar.gz

# cd ./rsync-3.1.1pre2

# ./configure --prefix=/usr/local/rsync

# make && make install

# vim /etc/rsyncd.conf

uid = nobody

gid = nobody

use chroot = no 

max connections = 10

strict modes = yes

pid file = /var/run/rsyncd.pid

lock file = /var/run/rsync.lock

log file = /var/log/rsyncd.log


[yrdce]

path = /customer_file

comment = Customer file

ignore errors

read only = =no

write only = no

hosts allow = 10.0.100.119

list = true

uid = root

gid = root

auth users = backup

secrets file = /usr/local/rsync/server.pass

# vim /usr/local/rsync/server.pass

backup:123456

# chmod 600 /usr/local/rsync/server.pass


# /usr/local/bin/rsync --daemon

# echo  “/usr/local/bin/rsync --daemon” >>/etc/rc.local


Client端

下载rsync-3.1.1pre2.tar.gz

# tar zxvf rsync-3.1.1pre2.tar.gz

# cd ./rsync-3.1.1pre2

# ./configure --prefix=/usr/local/rsync

# make && make install

# vim /usr/local/rsync/server.pass

123456

# chmod 600 /usr/local/rsync/server.pass

# /usr/local/bin/rsync -vzrtopg --delete --progress backup@10.0.100.118::yrdce /customer_file_backup --password-file=/usr/local/rsync/server.pass