diff --git a/Makefile.am b/Makefile.am index 06a0c53..43f65fe 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,11 +20,13 @@ dist_example_DATA = \ examples/lecho.lua \ examples/lgforce.lua \ examples/limagemagic.lua \ + examples/lpostcmd.lua \ examples/lrsync.lua \ examples/lrsyncssh.lua TESTS = \ tests/churn-rsync.lua \ tests/churn-rsyncssh.lua \ + tests/churn-direct.lua \ tests/exclude-rsync.lua \ tests/exclude-rsyncssh.lua \ tests/l4rsyncdata.lua diff --git a/lsyncd.lua b/lsyncd.lua index 7422ab6..8fa16ac 100644 --- a/lsyncd.lua +++ b/lsyncd.lua @@ -3431,8 +3431,14 @@ local default_direct = { -- gets all events ready for syncing local event, event2 = inlet.getEvent() - if event.etype == "Create" or event.etpye == "Modifiy" then - spawn(event, "/bin/cp", "-r", event.sourcePath, event.targetPathdir) + if event.etype == "Create" or event.etype == "Modifiy" then + spawn(event, + "/bin/cp", + "-p", + event.sourcePath, + "-t", + event.targetPathdir + ) elseif event.etype == "Delete" then local tp = event.targetPath -- extra security check @@ -3493,6 +3499,11 @@ local default_direct = { -- Default delay is very short. -- delay = 1, + + ----- + -- For startup sync + -- + rsyncOps = "-lts", ----- -- On many system multiple disk operations just rather slow down diff --git a/tests/churn-direct.lua b/tests/churn-direct.lua index 031726e..3dba789 100755 --- a/tests/churn-direct.lua +++ b/tests/churn-direct.lua @@ -15,7 +15,7 @@ churn(srcdir, 10) local logs = {} --logs = {"-log", "Delay", "-log", "Fsevents" } -local pid = spawn("./lsyncd", "-nodaemon", "-delay", "5", +local pid = spawn("./lsyncd", "-nodaemon", "-direct", srcdir, trgdir, unpack(logs)) cwriteln("waiting for Lsyncd to startup")