環(huán)境:
Ubuntu 12.04.2
rsync version 3.0.9 protocol version 30
Copyright (C) 1996-2011 by Andrew Tridgell, Wayne Davison, and others. Web site: http://rsync./ Capabilities: 64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints, socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace, append, ACLs, xattrs, iconv, symtimes 被同步端配置(服務(wù)端)
/etc/rsyncd.conf
uid = 0
gid = 0 use chroot = yes
max connections = 4 pid file = /var/run/rsyncd.pid lock file = /var/run/rsync.lock log file = /var/log/rsyncd.log [downloads]
path = /home/tmp/ ignore errors read only = 0 list = 0 hosts allow = 172.25.197.184/24 hosts deny = 0.0.0.0/32 auth users = backup secrets file = /etc/rsyncd.pwd 將用戶名和密碼保存大/etc/rsyncd.pwd ,; 改權(quán)限 chmod 700 /etc/rsyncd.pwd。
啟動(dòng)/usr/bin/rsync --daemon
主動(dòng)同步端(客戶端)
rsync -vrtl --progress --delete --password-file=/root/rsync.pwd /home/dlh/* [email protected]::downloads
其中/root/rsync.pwd 只保存密碼,且記得改權(quán)限。
注意:--delete 選項(xiàng)是刪除服務(wù)端多余的文件(測試無效,如果客戶端有同名文件夾,,會(huì)將服務(wù)端的改文件夾下的文件刪除)
|
|