rsync 复制了第一个模块,但没有复制其他模块: rsync:change_dir "/volume2" (in volume1) failed: No such file or directory (2)

rsync 复制了第一个模块,但没有复制其他模块: rsync:change_dir "/volume2" (in volume1) failed: No such file or directory (2)

我有以下 rsyncd.conf :

$ egrep -v "^$|^#" /etc/rsyncd.conf
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
use chroot = no
read only = yes
dont compress = aac *.aiff *.aif *.avi *.m2ts *.m4v *.mov *.MOV *.mp4 *.mpg *.mxf *.tif *.wav *.png *.zip
exclude = .DS_Store desktop.ini \#recycle/
[volume1]
path = /volume1
[volume2]
path = /volume2
[volume3]
path = /volume3

这是这样rsync说的:

$ syncCommand="rsync --stats -Hauv -h -P"
$ $syncCommand --log-file=$HOME/log/synchro_detailed_ADN_$(date +%Y%m%d).log "rsync://SOURCE-SERVER:/volume1/Archive 04" "rsync://SOURCE-SERVER:/volume2/Archive 05" "rsync://SOURCE-SERVER:/volume3/Archive 06" /ring/0/share/Archives_ADN/ 2>&1 | tee ~/log/synchro_ADN_$(date +%Y%m%d).log
receiving incremental file list
rsync: change_dir "/volume2" (in volume1) failed: No such file or directory (2)
rsync: change_dir "/volume3" (in volume1) failed: No such file or directory (2)
rsync: failed to set times on "/ring/0/share/Archives_ADN/Archive 04": Operation not permitted (1)
Archive 04/

Number of files: 6,473 (reg: 6,235, dir: 238)
Number of created files: 0
Number of regular files transferred: 0
Total file size: 16.63T bytes
Total transferred file size: 0 bytes
Literal data: 0 bytes
Matched data: 0 bytes
File list size: 190.81K
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 270
Total bytes received: 208.94K

sent 270 bytes  received 208.94K bytes  4.70K bytes/sec
total size is 16.63T  speedup is 79,476,844.88
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1651) [generator=3.1.2]

EDIT0:似乎rsync一次只能复制一个模块:https://github.com/WayneD/rsync/issues/367#issuecomment-1232434700

为什么rsync只复制第一个模块( volume1)而不复制其他模块?

答案1

看来每个 rsync 命令只能从一个模块复制。这似乎是一个公平的限制,因为不同的模块可能需要不同的身份验证,并且基本上需要协议完全重新启动。rsync和手册页中似乎没有明确提及这一点rsyncd.conf。 2 个源的唯一示例使用同一模块两次,效果很好:

rsync -av host::modname/file{1,2} host::modname/file3 /dest/

相关内容