mirror of
https://github.com/octoleo/lsyncd.git
synced 2024-09-27 14:39:01 +00:00
and another one, failed moves on the host need at least to delete the move origin.
This commit is contained in:
parent
15cde269c4
commit
19c697b28d
10
lsyncd.lua
10
lsyncd.lua
@ -1243,7 +1243,11 @@ local Sync = (function()
|
|||||||
end
|
end
|
||||||
il = il - 1
|
il = il - 1
|
||||||
end
|
end
|
||||||
log("Delay", "New ",nd.etype,":",path)
|
if nd.path2 then
|
||||||
|
log("Delay", "New ",nd.etype,":",nd.path,"->",nd.path2)
|
||||||
|
else
|
||||||
|
log("Delay", "New ",nd.etype,":",nd.path)
|
||||||
|
end
|
||||||
-- no block or combo
|
-- no block or combo
|
||||||
table.insert(self.delays, nd)
|
table.insert(self.delays, nd)
|
||||||
end
|
end
|
||||||
@ -2907,12 +2911,14 @@ local default_rsyncssh = {
|
|||||||
local config = inlet.getConfig()
|
local config = inlet.getConfig()
|
||||||
|
|
||||||
-- makes move local on host
|
-- makes move local on host
|
||||||
|
-- if fails deletes the source...
|
||||||
if event.etype == 'Move' then
|
if event.etype == 'Move' then
|
||||||
log("Normal", "Moving ",event.path," -> ",event2.path)
|
log("Normal", "Moving ",event.path," -> ",event2.path)
|
||||||
spawn(event, "/usr/bin/ssh",
|
spawn(event, "/usr/bin/ssh",
|
||||||
config.host, "mv",
|
config.host, "mv",
|
||||||
config.targetdir .. event.path,
|
config.targetdir .. event.path,
|
||||||
config.targetdir .. event2.path)
|
config.targetdir .. event2.path,
|
||||||
|
"||", "rm", "-rf", config.targetdir .. event.path)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user