加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

Cygwin rsyncd发送的文件名太多

发布时间:2020-12-14 03:06:57 所属栏目:Linux 来源:网络整理
导读:我有rsyncd作为 Windows服务运行,但是当我尝试访问模块并从中同步时,我得到了我想要的文件,以及我不想要的文件 – 因为它们不在远程的那个模块中结束.为了测试,我只将一个文件放在备份文件夹中,名为“the_only_file”.从我的本地机器: username@local:~$rsy
我有rsyncd作为 Windows服务运行,但是当我尝试访问模块并从中同步时,我得到了我想要的文件,以及我不想要的文件 – 因为它们不在远程的那个模块中结束.为了测试,我只将一个文件放在备份文件夹中,名为“the_only_file”.从我的本地机器:
username@local:~$rsync username@remote::backup .

receiving incremental file list
file has vanished: "/proc" (in backup)
file has vanished: "/cygdrive/c" (in backup)
file has vanished: "/cygdrive/d" (in backup)
skipping non-regular file "dev/clipboard"
skipping non-regular file "dev/conin"
skipping non-regular file "dev/conout"
skipping non-regular file "dev/console"
skipping non-regular file "dev/dsp"
skipping non-regular file "dev/full"
skipping non-regular file "dev/kmsg"
skipping non-regular file "dev/null"
skipping non-regular file "dev/ptmx"
skipping non-regular file "dev/pty0"
skipping non-regular file "dev/random"
skipping non-regular file "dev/scd0"
skipping non-regular file "dev/sda"
skipping non-regular file "dev/sda1"
skipping non-regular file "dev/sda2"
skipping non-regular file "dev/sr0"
skipping non-regular file "dev/tty"
skipping non-regular file "dev/urandom"
skipping non-regular file "dev/windows"
skipping non-regular file "dev/zero"
./
the_only_file
cygdrive/
dev/

sent 70 bytes  received 613 bytes  455.33 bytes/sec
total size is 0  speedup is 0.00
rsync warning: some files vanished before they could be transferred (code 24) at main.c(1708) [generator=3.1.0]

username@local:~$ls
cygdrive dev the_only_file

我在cygwin中使用以下命令来创建服务:

cygrunsrv --install "rsyncd" --path "$(which rsync)" --args "--daemon --no-detach" --desc "Starts rsync daemon to accept rsync connections" --disp "rsync daemon" --type "auto"

我的rsyncd.conf非常简单:

chroot = yes
charset = UTF-8
log file = /var/log/rsyncd.log

[backup]
      uid = username
      secrets file = /cygdrive/c/cygwin/etc/rsyncd.secrets
      auth users = username
      path = /cygdrive/c/Users/username/backup
      list = false
      readonly = false
      dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz *.7z

我能做些什么来让Cygwin的rsyncd表现得像它应该的那样? (为什么它会尝试向我发送/ proc目录?太奇怪……)

解决方法

我通过我不想做的方式“解决”了这个问题:我在rsyncd.conf中添加了以下行:
exclude from = /cygdrive/c/cygwin/etc/rsyncd.exclude

rsyncd.exclude是:

- /dev/*
- /dev
- /cygdrive/*
- /cygdrive
- /proc

现在它按预期工作,但需要注意的是,这意味着我不能在我的共享的根目录中拥有名为“dev”,“proc”或“cygdrive”的目录/文件.对大多数人来说可能并不重要;有一个“cygdrive”或“proc”文件夹会让人感到困惑,但可以说一个论点是devs的文件夹会被称为“dev”或类似的东西.再次,似乎有些轻微,也许大多数人都不在乎.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读