From 78fa6208bf95146df84578ffc10a52c20e0d6311 Mon Sep 17 00:00:00 2001 From: Axel Kittenberger Date: Fri, 9 Nov 2012 20:15:42 +0100 Subject: [PATCH] adding a settings('string') get call, so a upstart again operation works again, adding archive to the checkgauge, adding keep_dirs --- default-rsync.lua | 94 +++++++++++++++++++++++------------------------ default.lua | 2 +- lsyncd.lua | 6 +++ 3 files changed, 53 insertions(+), 49 deletions(-) diff --git a/default-rsync.lua b/default-rsync.lua index ca6639e..6da1392 100644 --- a/default-rsync.lua +++ b/default-rsync.lua @@ -49,41 +49,38 @@ rsync.checkgauge = { target = true, rsync = { - -- rsync binary - binary = true, - _extra = true, - - -- rsync shortflags - verbose = true, - quiet = true, - checksum = true, - update = true, - links = true, - copy_links = true, - hard_links = true, - perms = true, - executability = true, acls = true, - xattrs = true, - owner = true, - group = true, - times = true, - sparse = true, - dry_run = true, - whole_file = true, - one_file_system = true, - prune_empty_dirs = true, - ignore_times = true, + archive = true, + binary = true, + checksum = true, compress = true, + copy_links = true, cvs_exclude = true, - protect_args = true, + dry_run = true, + executability = true, + group = true, + hard_links = true, + ignore_times = true, ipv4 = true, ipv6 = true, - - -- further rsync options + keep_dirlinks = true, + links = true, + one_file_system = true, + owner = true, + perms = true, + protect_args = true, + prune_empty_dirs = true, + quiet = true, rsh = true, rsync_path = true, + sparse = true, temp_dir = true, + times = true, + update = true, + verbose = true, + whole_file = true, + xattrs = true, + _extra = true, }, } @@ -403,31 +400,32 @@ rsync.prepare = function( local computedN = 2 local shortFlags = { - verbose = 'v', - quiet = 'q', - checksum = 'c', - update = 'u', - links = 'l', - copy_links = 'L', - hard_links = 'H', - perms = 'p', - executability = 'E', acls = 'A', - xattrs = 'X', - owner = 'o', - group = 'g', - times = 't', - sparse = 'S', - dry_run = 'n', - whole_file = 'W', - one_file_system = 'x', - prune_empty_dirs = 'm', - ignore_times = 'I', + checksum = 'c', compress = 'z', + copy_links = 'L', cvs_exclude = 'C', - protect_args = 's', + dry_run = 'n', + executability = 'E', + group = 'g', + hard_links = 'H', + ignore_times = 'I', ipv4 = '4', - ipv6 = '6' + ipv6 = '6', + keep_dirlinks = 'K', + links = 'l', + one_file_system = 'x', + owner = 'o', + perms = 'p', + protect_args = 's', + prune_empty_dirs = 'm', + quiet = 'q', + sparse = 'S', + times = 't', + update = 'u', + verbose = 'v', + whole_file = 'W', + xattrs = 'X', } local shorts = { '-' } diff --git a/default.lua b/default.lua index 6e97062..dade6cc 100644 --- a/default.lua +++ b/default.lua @@ -100,7 +100,7 @@ default.collect = function( agent, exitcode ) log('Normal', 'Startup of "',agent.source,'" finished.') return 'ok' elseif rc == 'again' then - if settings.insist then + if settings('insist') then log( 'Normal', 'Retrying startup of "', diff --git a/lsyncd.lua b/lsyncd.lua index 417f0d6..2fa0a01 100644 --- a/lsyncd.lua +++ b/lsyncd.lua @@ -4332,6 +4332,12 @@ end -- The Lsyncd 2.1 settings call -- function settings( a1 ) + -- if a1 is a string this is a get operation + if typeof( a1 ) == 'string' then + return uSettings[ a1 ] + end + + -- if its a table it sets all the value of the bale for k, v in pairs( a1 ) do if type( k ) ~= 'number' then uSettings[ k ] = v