From d79ce6da50408a6094e9313a877c4b282f4779ac Mon Sep 17 00:00:00 2001 From: Axel Kittenberger Date: Tue, 25 Jan 2011 11:33:14 +0000 Subject: [PATCH] allow to configure xargs --- lsyncd.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lsyncd.lua b/lsyncd.lua index 443b3c8..ee1ffe0 100644 --- a/lsyncd.lua +++ b/lsyncd.lua @@ -3223,12 +3223,12 @@ local default_rsyncssh = { end local sPaths = table.concat(paths, "\n") - local zPaths = table.concat(paths, "\000") + local zPaths = table.concat(paths, config.xargs.delimiter) log("Normal", "Deleting list\n", sPaths) spawn(elist, "/usr/bin/ssh", "<", zPaths, config.host, - "xargs", "-0", "rm -rf") + config.xargs.binary, config.xargs.xparams) return end @@ -3355,6 +3355,14 @@ local default_rsyncssh = { -- Default delay. -- delay = 15, + + ----- + -- Delimiter, the binary and the paramters passed to xargs + -- xargs is used to delete multiple remote files, when ssh access is + -- available this is simpler than to build filters for rsync for this. + -- Default uses '0' as limiter, you might override this for old systems. + -- + xargs = {delimiter = '\000', binary = "xargs", xparams = {"-0", "rm -rf"}} } -----