mirror of
https://github.com/octoleo/lsyncd.git
synced 2024-12-12 22:27:50 +00:00
This commit is contained in:
parent
edab583e92
commit
de21ec41fa
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user