rsync后台服务

时间:2022-05-11
本文章向大家介绍rsync后台服务,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

192.168.6.71 为服务端

192.168.6.72 为客户端

在服务器启动daemon
rsync --daemon
新建配置文件
vim /etc/rsyncd.conf
port=8730
log file=var/log/rsync.log
pid file=/var/run/rsync.pid
[alex]
path=/tmp/rsync
use chroot=yes
max connections=4
read only=no
list=yes
uid=root
gid=root
auth users=alex
secrets file=/etc/rs.passwd
hosts allow=192.168.6.72
密码文件
vim /etc/rs.passwd 
alex:1234
给密码文件添加权限
chmod 600 /etc/rs.passwd 
在客户端执行命令
# rsync -av --port 8730 alex@192.168.6.71::alex/11 ./
Password: 
receiving incremental file list
11
sent 73 bytes  received 134 bytes  46.00 bytes/sec
total size is 0  speedup is 0.00