fixing rsyncssh

This commit is contained in:
Axel Kittenberger 2010-11-24 21:26:41 +00:00
parent 1994035a2e
commit c604285f63
3 changed files with 22 additions and 8 deletions

View File

@ -2547,7 +2547,7 @@ local default_rsync = {
spawn(elist, "/usr/bin/rsync",
"<", filterS,
config.rsyncOps,
"-rv",
"-r",
"--delete",
"--force",
"--include-from=-",
@ -2638,9 +2638,9 @@ local default_rsyncssh = {
local sPaths = table.concat(paths, "\n")
log("Normal", "Deleting list\n", sPaths)
spawn(event, "/usr/bin/ssh",
spawn(elist, "/usr/bin/ssh",
"<", sPaths,
config.host, "xargs", "echo", "rm -rf")
config.host, "xargs", "rm -rf")
return
end
@ -2649,10 +2649,18 @@ local default_rsyncssh = {
function(e)
return e.etype ~= "Move" and e.etype ~= "Delete"
end)
local paths = table.concat(elist.getPaths(), "\n")
log("Normal", "Rsyncing list\n", paths)
local paths = elist.getPaths()
-- removes trailing slashes from dirs.
for k, v in ipairs(paths) do
if string.byte(v, -1) == 47 then
paths[k] = string.sub(v, 1, -2)
end
end
local sPaths = table.concat(paths, "\n") -- TODO 0 delimiter
log("Normal", "Rsyncing list\n", sPaths)
spawn(elist, "/usr/bin/rsync",
"<", paths,
"<", sPaths,
config.rsyncOps,
"--files-from=-",
config.source,
@ -2728,7 +2736,7 @@ local default_rsyncssh = {
-----
-- allow several processes
--
maxProcesses = 10,
maxProcesses = 1,
-----
-- Default delay.

View File

@ -14,6 +14,9 @@ local trgdir = tdir.."trg/"
posix.mkdir(srcdir)
posix.mkdir(trgdir)
-- makes some startup data
churn(srcdir, 10)
local logs = {}
--logs = {"-log", "Inotify", "-log", "Exec" }
local pid = spawn("./lsyncd", "-nodaemon",

View File

@ -14,9 +14,12 @@ local trgdir = tdir.."trg/"
posix.mkdir(srcdir)
posix.mkdir(trgdir)
-- makes some startup data
churn(srcdir, 10)
local logs = {}
--logs = {"-log", "Inotify", "-log", "Exec" }
--logs = {"-log", "all" }
--logs = {"-log", "Delay"}
local pid = spawn("./lsyncd", "-nodaemon",
"-rsyncssh", srcdir, "localhost", trgdir,