(1)服务端先安装rsync。
(2) 完成配置--以下配置是需要手动创建并配置
vim rsyncd.conf
uid = xxx
gid = xxx
port = 8099
strict modes =yes
use chroot = no
hosts allow = *
log format = "%t %a %m %f %b %P %o"
transfer logging = yes
log file = /home/xxx/rsync/log/rsync.log
[backup]
read only =no
path = /home/xxx/backup/
secrets file = /home/xxx/rsync/rsync.pas
motd file = /home/xxx/rsync/rsyncd.motd
auth users = test
vim rsyncd.motd
Welcome the rsync services for test
vim rsync.pas
test:123456
(3) 启动rsync
/usr/bin/rsync --daemon --config=/home/xxx/rsync/rsyncd.conf
(4) 客户端
创建密码文件vim /home/rsync.pas
123456
传输命令:rsync -vzrtopg --port=8099 --password-file=/home/rsync.pas /home/send_file.tgz test@ip::backup