linux rsync

服务端
建立配置 vi /etc/rsyncd.conf
uid = nobody
gid = nobody
use chroot = no
max connections = 4
pid file = /data/service/rsync/test/rsyncd.pid
lock file = /data/service/rsync/test/rsync.lock
log file = /data/service/rsync/test/rsyncd.log
#ignore errors
hosts allow = 10.10.10.10(容许链接的IP)
hosts deny = 0.0.0.0/0
list = true(容许客户端查看module)

#10.10.10.10
[backup]   (module名称)
path=/data/service/rsync/logs/     (备份路径)
read only = false  (可写)
auth users = root  (容许客户端链接的用户,多个可用",“分开)
secrets file = /etc/backserver.pas (密码文件,格式为user:pwd,权限为600)

启动rsync
rsync --daemon --password-file=/etc/rsyncd.conf shell

客户端
rsync rsync://10.10.10.10 查看可用的module
rsync -avzP /source rsync://10.10.10.10/backup --password-file=/etc/client.pas(只须要密码,权限为600) ui

可根据本身须要去定时执行 code

Local:  rsync [OPTION...] SRC... [DEST]

Access via remote shell:
  Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]
  Push: rsync [OPTION...] SRC... [USER@]HOST:DEST

Access via rsync daemon:
  Pull: rsync [OPTION...] [USER@]HOST::SRC... [DEST]
        rsync [OPTION...] rsync://[USER@]HOST[:PORT]/SRC... [DEST]
  Push: rsync [OPTION...] SRC... [USER@]HOST::DEST
        rsync [OPTION...] SRC... rsync://[USER@]HOST[:PORT]/DEST
相关文章
相关标签/搜索