Ssh

在 rsync 中,“bwlimit”參數被明確忽略,如何解決這個問題

  • December 29, 2021

我在埠 873 上偵聽了 rsyncd 版本 3.1.2,我想限制連接到我的客戶端下載我的文件的頻寬。我在配置文件中都添加了 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 連接?

bwlimit只能用作命令行參數,但不能用於/etc/rsyncd.conf

引用自:https://serverfault.com/questions/1088451