mirror of
https://github.com/octoleo/lsyncd.git
synced 2024-06-11 20:52:23 +00:00
yes better now
This commit is contained in:
parent
e6443f8515
commit
338dac95b4
|
@ -1251,12 +1251,14 @@ local Sync = (function()
|
||||||
f:write("\n")
|
f:write("\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--[[--
|
||||||
-- DEBUG delays
|
-- DEBUG delays
|
||||||
local _delay = delay
|
local _delay = delay
|
||||||
delay = function(self, ...)
|
delay = function(self, ...)
|
||||||
_delay(self, ...)
|
_delay(self, ...)
|
||||||
statusReport(self, io.stdout)
|
statusReport(self, io.stdout)
|
||||||
end
|
end
|
||||||
|
--]]
|
||||||
|
|
||||||
-----
|
-----
|
||||||
-- Creates a new Sync
|
-- Creates a new Sync
|
||||||
|
|
|
@ -16,9 +16,7 @@ local trgdir = tdir.."trg/"
|
||||||
|
|
||||||
posix.mkdir(srcdir)
|
posix.mkdir(srcdir)
|
||||||
posix.mkdir(trgdir)
|
posix.mkdir(trgdir)
|
||||||
--local pid = spawn("./lsyncd","-nodaemon","-rsync",srcdir,trgdir,"-log", "all")
|
local pid = spawn("./lsyncd","-nodaemon","-rsync",srcdir,trgdir)
|
||||||
local pid = spawn("./lsyncd","-nodaemon","-rsync",srcdir,trgdir,
|
|
||||||
"-log", "Exec")
|
|
||||||
|
|
||||||
cwriteln("waiting for Lsyncd to startup")
|
cwriteln("waiting for Lsyncd to startup")
|
||||||
posix.sleep(1)
|
posix.sleep(1)
|
||||||
|
@ -261,13 +259,12 @@ for i, d in ipairs(dice) do
|
||||||
d[1] = ndice
|
d[1] = ndice
|
||||||
end
|
end
|
||||||
|
|
||||||
for ai=1,20 do
|
for ai=1,5000 do
|
||||||
-- throw a die what to do
|
-- throw a die what to do
|
||||||
local acn = math.random(ndice)
|
local acn = math.random(ndice)
|
||||||
for i, d in ipairs(dice) do
|
for i, d in ipairs(dice) do
|
||||||
if acn <= d[1] then
|
if acn <= d[1] then
|
||||||
d[2]()
|
d[2]()
|
||||||
posix.sleep(2)
|
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -276,12 +273,16 @@ end
|
||||||
cwriteln("waiting for Lsyncd to finish its jobs.")
|
cwriteln("waiting for Lsyncd to finish its jobs.")
|
||||||
posix.sleep(20)
|
posix.sleep(20)
|
||||||
|
|
||||||
-- cwriteln("killing the Lsyncd daemon")
|
cwriteln("killing the Lsyncd daemon")
|
||||||
-- posix.kill(pid)
|
posix.kill(pid)
|
||||||
-- local _, exitmsg, exitcode = posix.wait(lpid)
|
local _, exitmsg, lexitcode = posix.wait(lpid)
|
||||||
-- cwriteln("Exitcode of Lsyncd = ", exitmsg, " ", exitcode)
|
cwriteln("Exitcode of Lsyncd = ", exitmsg, " ", lexitcode)
|
||||||
|
|
||||||
exitcode = os.execute("diff -r "..srcdir.." "..trgdir)
|
exitcode = os.execute("diff -r "..srcdir.." "..trgdir)
|
||||||
cwriteln("Exitcode of diff = ", exitcode)
|
cwriteln("Exitcode of diff = ", exitcode)
|
||||||
os.exit(exitcode)
|
if lexitcode ~= 0 then
|
||||||
|
os.exit(lexitcode)
|
||||||
|
else
|
||||||
|
os.exit(exitcode)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user