rsync

# Rsync configuration file
secrets file = /etc/rsyncd.secrets #认证用户名和密码文件的名称和位置
motd file = /etc/rsyncd.motd #欢迎文件,可自己编辑
read>list = yes
uid = ubuntu
gid = ubuntu
use chroot = no
max connections = 5
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
# Remote sync configuration module
[testsync]
comment = testsync directory
path = /home/ubuntu/11
#auth users = rsync
read only = no

 

 生成密码文件
echo "rsync:password" >> /etc/rsyncd.secrets
chmod 600 /etc/rsyncd.secrets

启动rsync
rsync --daemon

从客户端同步文件

rm  -rf 11/*

rsync -vzrtopg --progress --password-file=/etc/test /home/ubuntu/22/* rsync@120.132.56.246::testsync

 

 

http://www.cnblogs.com/chijianqiang/archive/2011/05/09/2041537.html

posted @ 2015-06-30 08:19  lianhuaren  阅读(36)  评论(0)    收藏  举报