![Rsync 守护进程将参数解释为 rsync.conf 中的命令](https://linux22.com/image/30785/Rsync%20%E5%AE%88%E6%8A%A4%E8%BF%9B%E7%A8%8B%E5%B0%86%E5%8F%82%E6%95%B0%E8%A7%A3%E9%87%8A%E4%B8%BA%20rsync.conf%20%E4%B8%AD%E7%9A%84%E5%91%BD%E4%BB%A4.png)
我在 Linux 上使用了 rsync。当我重述它时,它向我显示以下错误:
sudo /etc/init.d/rsync restart
/etc/rsyncd.conf: line 13: [ftp]: command not found
/etc/rsyncd.conf: line 15: comment: command not found
/etc/rsyncd.conf: line 16: path: command not found
/etc/rsyncd.conf: line 17: use: command not found
/etc/rsyncd.conf: line 19: lock: command not found
/etc/rsyncd.conf: line 21: read: `=': not a valid identifier
/etc/rsyncd.conf: line 22: list: command not found
/etc/rsyncd.conf: line 23: uid: command not found
/etc/rsyncd.conf: line 24: gid: command not found
/etc/rsyncd.conf: line 31: strict: command not found
/etc/rsyncd.conf: line 34: ignore: command not found
/etc/rsyncd.conf: line 35: ignore: command not found
/etc/rsyncd.conf: line 36: transfer: command not found
timeout: invalid time interval `='
Try `timeout --help' for more information.
/etc/rsyncd.conf: line 39: refuse: command not found
/etc/rsyncd.conf: line 40: dont: command not found
我知道它应该考虑在/etc/rsync.conf
文件中获取 echo 参数,但它将它们解释为命令。
更新
vim /etc/rsyncd.conf
# for pid file, do not use /var/run/rsync.pid if
# you are going to run rsync out of the init.d script.
# pid file=/var/run/rsyncd.pid
#syslog facility=daemon
#socket options=
# MODULE OPTIONS
[ftp]
comment = public archive
path = /var/www/pub
use chroot = yes
# max connections=10
lock file = /var/lock/rsyncd
# the default for read only is yes...
read only = yes
list = yes
uid = nobody
gid = nogroup
# exclude =
# exclude from =
# include =
# include from =
# auth users =
# secrets file = /etc/rsyncd.secrets
strict modes = yes
# hosts allow =
# hosts deny =
ignore errors = no
ignore nonreadable = yes
transfer logging = no
# log format = %t: host %h (%a) %o %f (%l bytes). Total %b bytes.
timeout = 600
refuse options = checksum dry-run
dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz
更新2