Closed GoogleCodeExporter closed 9 years ago
As just answered on the list. This script is for Lsyncd 2.0.0-2.0.4 and doesn't
fit Lsyncd 2.0.5
Again Sorry for the iface change, but the error you see is because init() now
receives an event and not an inlet, thats why getConfig() fails on the event:
Change 1: the 'init' function no longer receives an inlet and has to
create a "Blanket" event. It know receives an "Init" event right away.
So instead of old:
> init = function(inlet)
> local config = inlet.getConfig()
> local event = inlet.createBlanketEvent()
> log("Normal", "Recursive startup sync: ",
> config.syncid, ":", config.source)
> spawn(event, "/usr/sbin/csync2", "-C", config.syncid,
> "-x")
> end,
It should now be:
> init = function(event)
> local inlet = event.inlet;
> local config = inlet.getConfig();
> log("Normal", "Recursive startup sync: ",
> config.syncid, ":", config.source)
> spawn(event, "/usr/sbin/csync2", "-C", config.syncid,
> "-x")
> end,
Also "Blanket" events are no longer used for Startup, or even by
default at all. The Startup event is now called "Init"
So instead of
> if not agent.isList and agent.etype == "Blanket" then
do
> if not agent.isList and agent.etype == "Init" then
Similar
> local elist = inlet.getEvents(function(event)
> return event.etype ~= "Blanket"
> end)
becomes
> local elist = inlet.getEvents(function(event)
> return event.etype ~= "Blanket"
> end)
Original comment by axk...@gmail.com
on 12 Oct 2011 at 9:34
Original comment by axk...@gmail.com
on 1 Nov 2011 at 10:17
Original issue reported on code.google.com by
t00_m4d_f00@web.de
on 12 Oct 2011 at 9:28