一、服务器配置
创建/etc/rsyncd.conf文件,内容如下:
- uid = root
- gid = root
- max connections = 25
- pid file = /var/run/rsyncd.pid
- lock file = /var/run/rsync.lock
- log file = /var/log/rsyncd.log
- secrets file = /etc/rsyncd.passwd
- [BJData]
- path = /data/disk11/BJData
- comment = BJData
- ignore errors
- read only = no
- list = true
- auth users = backup
配置/etc/xinetd.d/rsync文件,修改disabled=no,如下所示:
- service rsync
- {
- disable = no
- socket_type = stream
- wait = no
- user = root
- server = /usr/bin/rsync
- server_args = --daemon
- log_on_failure += USERID
- }
- ~
创建用户名与密码文件
- touch /etc/rsyncd.passwd
- chmod 600 /etc/rsyncd.passwd
在
/etc/rsyncd.passwd文件编辑如下:用户名为:backup
密码名为:111111
启动xinetd服务:
二、客户端配置
①创建密码文件
- touch /etc/rsync.pass
- chmod 600 /etc/rsync.pass
将服务器端密码写入/etc/rsyncd.passwd文件:
②执行下面的命令可以进行同步
- rsync -vzrtopg --delete --progress /data/disk05/BJData/ backup@x.x.x.x::BJData --password-file=/etc/rsync.pass
搞定。
阅读(1160) | 评论(0) | 转发(0) |