在 Ubuntu 20.04 上安装 lsyncd
创建 lsyncd.conf.lua
settings = {
logfile = "/var/log/lsyncd/lsyncd.log",
statusFile = "/var/log/lsyncd/lsyncd.status"
}
sync {
default.rsyncssh,
source = "/var/www/",
host = "1.1.1.1",
targetdir = "/var/vidsg"
}
systemctl status lsyncd 给我这个
● lsyncd.service - LSB: lsyncd daemon init script
Loaded: loaded (/etc/init.d/lsyncd; generated)
Active: active (exited) since Sun 2021-08-15 00:04:19 CEST; 11min ago
Docs: man:systemd-sysv-generator(8)
Process: 3460 ExecStart=/etc/init.d/lsyncd start (code=exited, status=0/SUCCESS)
systemd[1]: Starting LSB: lsyncd daemon init script...
lsyncd[3460]: * Starting synchronization daemon lsyncd
lsyncd[3466]: Error: Do not use settings = { ... }
lsyncd[3466]: please use settings{ ... } (without the equal sign)
lsyncd[3460]: ...fail!
systemd[1]: Started LSB: lsyncd daemon init script.
如果我运行 journalctl 我会看到:
Aug 14 22:36:10 vmi098767.myserver.net lsyncd[1004057]: ...fail!
Aug 14 22:36:10 vmi098767.myserver.net systemd[1]: Started LSB: lsyncd daemon init script.
Aug 14 22:37:28 vmi098767.myserver.net systemd[1]: Stopping LSB: lsyncd daemon init script...
Aug 14 22:37:28 vmi098767.myserver.net lsyncd[1004328]: * Stopping synchronization daemon lsyncd
Aug 14 22:37:28 vmi098767.myserver.net lsyncd[1004328]: ...done.
Aug 14 22:37:28 vmi098767.myserver.net systemd[1]: lsyncd.service: Succeeded.
Aug 14 22:37:28 vmi098767.myserver.net systemd[1]: Stopped LSB: lsyncd daemon init script.
Aug 14 22:37:28 vmi098767.myserver.net systemd[1]: Starting LSB: lsyncd daemon init script...
Aug 14 22:37:28 vmi098767.myserver.net lsyncd[1004345]: * Starting synchronization daemon lsyncd
Aug 14 22:37:28 vmi098767.myserver.net lsyncd[1004350]: Error: Do not use settings = { ... }
Aug 14 22:37:28 vmi098767.myserver.net lsyncd[1004350]: please use settings{ ... } (without the equal sign)
Aug 14 22:37:28 vmi098767.myserver.net lsyncd[1004345]: ...fail!
Aug 14 22:37:28 vmi098767.myserver.net systemd[1]: Started LSB: lsyncd daemon init script.
Aug 14 22:39:28 vmi098767.myserver.net systemd[1]: Stopping LSB: lsyncd daemon init script...
Aug 14 22:39:28 vmi098767.myserver.net lsyncd[1004484]: * Stopping synchronization daemon lsyncd
Aug 14 22:39:28 vmi098767.myserver.net lsyncd[1004484]: ...done.
Aug 14 22:39:28 vmi098767.myserver.net systemd[1]: lsyncd.service: Succeeded.
Aug 14 22:39:28 vmi098767.myserver.net systemd[1]: Stopped LSB: lsyncd daemon init script.
Aug 14 22:39:28 vmi098767.myserver.net systemd[1]: Starting LSB: lsyncd daemon init script...
Aug 14 22:39:28 vmi098767.myserver.net lsyncd[1004499]: * Starting synchronization daemon lsyncd
Aug 14 22:39:28 vmi098767.myserver.net lsyncd[1004505]: Error: Do not use settings = { ... }
Aug 14 22:39:28 vmi098767.myserver.net lsyncd[1004505]: please use settings{ ... } (without the equal sign)
Aug 14 22:39:28 vmi098767.myserver.net lsyncd[1004499]: ...fail!
Aug 14 22:39:28 vmi098767.myserver.net systemd[1]: Started LSB: lsyncd daemon init script.
Aug 14 22:57:10 vmi098767.myserver.net systemd[1]: Stopping LSB: lsyncd daemon init script...
Aug 14 22:57:10 vmi098767.myserver.net lsyncd[1005037]: * Stopping synchronization daemon lsyncd
Aug 14 22:57:10 vmi098767.myserver.net lsyncd[1005037]: ...done.
Aug 14 22:57:10 vmi098767.myserver.net systemd[1]: lsyncd.service: Succeeded.
Aug 14 22:57:10 vmi098767.myserver.net systemd[1]: Stopped LSB: lsyncd daemon init script.
Aug 14 22:57:10 vmi098767.myserver.net systemd[1]: Starting LSB: lsyncd daemon init script...
Aug 14 22:57:10 vmi098767.myserver.net lsyncd[1005055]: * Starting synchronization daemon lsyncd
Aug 14 22:57:10 vmi098767.myserver.net lsyncd[1005060]: Error: Do not use settings = { ... }
Aug 14 22:57:10 vmi098767.myserver.net lsyncd[1005060]: please use settings{ ... } (without the equal sign)
Aug 14 22:57:10 vmi098767.myserver.net lsyncd[1005055]: ...fail!
Aug 14 22:57:10 vmi098767.myserver.net systemd[1]: Started LSB: lsyncd daemon init script.
Aug 14 22:59:13 vmi098767.myserver.net systemd[1]: Stopping LSB: lsyncd daemon init script...
Aug 14 22:59:13 vmi098767.myserver.net lsyncd[1005114]: * Stopping synchronization daemon lsyncd
Aug 14 22:59:13 vmi098767.myserver.net lsyncd[1005114]: ...done.
Aug 14 22:59:13 vmi098767.myserver.net systemd[1]: lsyncd.service: Succeeded.
Aug 14 22:59:13 vmi098767.myserver.net systemd[1]: Stopped LSB: lsyncd daemon init script.
Aug 14 22:59:13 vmi098767.myserver.net systemd[1]: Starting LSB: lsyncd daemon init script...
Aug 14 22:59:13 vmi098767.myserver.net lsyncd[1005132]: * Starting synchronization daemon lsyncd
Aug 14 22:59:13 vmi098767.myserver.net lsyncd[1005139]: Error: Do not use settings = { ... }
Aug 14 22:59:13 vmi098767.myserver.net lsyncd[1005139]: please use settings{ ... } (without the equal sign)
Aug 14 22:59:13 vmi098767.myserver.net lsyncd[1005132]: ...fail!
Aug 14 22:59:13 vmi098767.myserver.net systemd[1]: Started LSB: lsyncd daemon init script.
Aug 14 22:59:58 vmi098767.myserver.net systemd[1]: Stopping LSB: lsyncd daemon init script...
Aug 14 22:59:58 vmi098767.myserver.net lsyncd[1005250]: * Stopping synchronization daemon lsyncd
Aug 14 22:59:58 vmi098767.myserver.net lsyncd[1005250]: ...done.
Aug 14 22:59:58 vmi098767.myserver.net systemd[1]: lsyncd.service: Succeeded.
Aug 14 22:59:58 vmi098767.myserver.net systemd[1]: Stopped LSB: lsyncd daemon init script.
-- Reboot --
Aug 14 23:00:24 vmi098767.myserver.net systemd[1]: Starting LSB: lsyncd daemon init script...
Aug 14 23:00:25 vmi098767.myserver.net lsyncd[437]: * Starting synchronization daemon lsyncd
Aug 14 23:00:25 vmi098767.myserver.net lsyncd[453]: Error: Do not use settings = { ... }
Aug 14 23:00:25 vmi098767.myserver.net lsyncd[453]: please use settings{ ... } (without the equal sign)
Aug 14 23:00:25 vmi098767.myserver.net lsyncd[437]: ...fail!
如何解决这个问题。
错误本身正在显示解决方案。
lsyncd[3466]:错误:不要使用 settings = { ... } lsyncd[3466]:请使用 settings{ ... }(不带等号)
您的配置文件以 settings = {
相反,应该是,设置{