我有 rsyncd 版本 3.1.2 在端口 873 上监听,我想限制连接到我的客户端下载文件的带宽。我在配置文件中添加了 bwlimit:
uid = nobody
gid = nogroup
[data]
path = /var/data/files/
comment = Repo
read only = yes
bwlimit = 10
并在守护进程配置文件上尝试了它
[Unit]
Description=fast remote file copy program daemon
ConditionPathExists=/etc/rsyncd.conf
[Service]
ExecStart=/usr/bin/rsync --daemon --no-detach --bwlimit=10
[Install]
WantedBy=multi-user.target
在任何一种情况下,当我的客户端连接 rsync 下载文件时,每个日志都会忽略该参数:
Dec 29 08:27:12 pubserver systemd[1]: Started fast remote file copy program daemon.
Dec 29 08:27:12 pubserver rsyncd[32533]: rsyncd version 3.1.2 starting, listening on port 873
Dec 29 08:29:42 pubserver rsyncd[1534]: Unknown Parameter encountered: "bwlimit"
Dec 29 08:29:42 pubserver rsyncd[1534]: IGNORING unknown parameter "bwlimit"
Dec 29 08:29:42 pubserver rsyncd[1534]: connect from workspace (10.155.120.1)
Dec 29 08:29:42 pubserver rsyncd[1534]: rsync on repo/ from workspace (10.155.120.1)
Dec 29 08:29:42 pubserver rsyncd[1534]: building file list
Dec 29 08:29:44 pubserver rsyncd[1534]: sent 17567 bytes received 72 bytes total size 16787953
有没有办法让这个限制起作用?或者,如果不再支持 bwlimit,如何减慢/限制 rsync 连接?
答案1
bwlimit
只能用作命令行参数,不能用于/etc/rsyncd.conf