This commit is contained in:
Axel Kittenberger 2010-10-19 20:21:38 +00:00
parent edab583e92
commit de21ec41fa
2 changed files with 10 additions and 3 deletions

View File

@ -11,4 +11,12 @@ settings = {
add("s", "d")
-- add("s/s1", "t")
----
-- Called for every source .. target pair on startup
-- Returns the pid of a spawned process
-- Return 0 if you dont exec something.
function startup_action(source, target)
print("startup recursive rsync: " .. source .. " -> " .. target)
return exec("/usr/bin/rsync", "-ltrs", source, target)
end

View File

@ -159,9 +159,7 @@ function default_startup()
print("--- startup ---")
local pids = { }
for i, o in ipairs(origins) do
print("startup recursive rsync: " .. o.source .. " -> " .. o.targetpath)
-- TODO userchangeablefunction
pid = lsyncd.exec("/usr/bin/rsync", "-ltrs", o.source, o.targetpath)
startup_action(o.source, o.targetpath)
table.insert(pids, pid)
end
lsyncd.wait_pids(pids, "startup_collector")
@ -169,6 +167,7 @@ function default_startup()
end
startup = default_startup
-----
-- Called by the core for every child process that
-- finished in startup phase