So I installed the daemon and configure it as :
matias@~
$ cat /etc/lsyncd/lsyncd.conf.lua
settings {
logfile = "/var/log/lsyncd/lsyncd.log",
statusFile = "/tmp/lsyncd.stat",
statusInterval = 1,
verbose = false,
}
sync {
default.rsync,
source = '/home/matias/Remoto',
target = '[email protected]:./Remoto',
delay = 1,
rsync= {
owner = true,
perms = true,
group = true,
acls = true,
verbose = true,
rsh = "/usr/bin/ssh -i /home/matias/.ssh/id_rsa.pub -p 22 -o StrictHostKeyChecking=no"
}
}
I can see the daemon is up and running :
matias@~
$ sudo systemctl status lsyncd
[sudo] password for matias:
● lsyncd.service - LSB: lsyncd daemon init script
Loaded: loaded (/etc/init.d/lsyncd; bad; vendor preset: enabled)
Active: active (exited) since jue 2020-01-23 16:18:05 -03; 3h 28min ago
Docs: man:systemd-sysv-generator(8)
Process: 13723 ExecStop=/etc/init.d/lsyncd stop (code=exited, status=0/SUCCESS
Process: 13731 ExecStart=/etc/init.d/lsyncd start (code=exited, status=0/SUCCE
ene 23 16:18:05 lenovoI5 systemd[1]: Starting LSB: lsyncd daemon init script...
ene 23 16:18:05 lenovoI5 lsyncd[13731]: * Starting synchronization daemon lsync
ene 23 16:18:05 lenovoI5 lsyncd[13731]: ...done.
ene 23 16:18:05 lenovoI5 systemd[1]: Started LSB: lsyncd daemon init script.
And if I run journalctl I can see this :
matias@~
$ sudo journalctl -u lsyncd
-- Logs begin at jue 2020-01-23 10:20:58 -03, end at jue 2020-01-23 19:47:45 -03
......
ene 23 16:06:46 lenovoI5 lsyncd[13218]: Error: error preparing /etc/lsyncd/lsync
ene 23 16:06:46 lenovoI5 lsyncd[13218]: ...fail!
ene 23 16:18:05 lenovoI5 systemd[1]: Starting LSB: lsyncd daemon init script...
ene 23 16:18:05 lenovoI5 lsyncd[13731]: * Starting synchronization daemon lsync
ene 23 16:18:05 lenovoI5 lsyncd[13731]: ...done.
ene 23 16:18:05 lenovoI5 systemd[1]: Started LSB: lsyncd daemon init script
This lines proves that it actually reads the config file and I corrected it :
ene 23 16:06:46 lenovoI5 lsyncd[13218]: Error: error preparing /etc/lsyncd/lsyncd.conf.lua: Parameter "identityFile" unknown. (if this is not a ty
ene 23 16:06:46 lenovoI5 lsyncd[13218]: ...fail!
I can see the stat log being created :
matias@~
$ cat /tmp/lsyncd.stat
Lsyncd status report at Thu Jan 23 16:18:05 2020
Sync1 source=/home/matias/Remoto/
There are 1 delays
active Init
Excluding:
nothing.
Inotify watching 4 directories
1: /home/matias/Remoto/
2: /home/matias/Remoto/Documentos/
3: /home/matias/Remoto/Archivos/
4: /home/matias/Remoto/Mas/
The problem is, files and dirs are not getting sync on the remote server. I created folder Mas after restarting the service and after 1 hour it did not get updated.
The weird thing is that it did work when I manual run it as :
lsyncd /etc/lsyncd/lsyncd.conf.lua
What am I doing wrong?
0 Answers