mirror of
https://github.com/octoleo/lsyncd.git
synced 2024-06-05 01:40:50 +00:00
cleanups
This commit is contained in:
parent
ba52ee1a6f
commit
faa582e259
79
lsyncd.lua
79
lsyncd.lua
|
@ -4662,7 +4662,10 @@ function runner.configure( args, monitors )
|
||||||
delay =
|
delay =
|
||||||
{
|
{
|
||||||
1,
|
1,
|
||||||
function( secs )
|
function
|
||||||
|
(
|
||||||
|
secs
|
||||||
|
)
|
||||||
clSettings.delay = secs + 0
|
clSettings.delay = secs + 0
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
@ -4670,7 +4673,8 @@ function runner.configure( args, monitors )
|
||||||
insist =
|
insist =
|
||||||
{
|
{
|
||||||
0,
|
0,
|
||||||
function( )
|
function
|
||||||
|
( )
|
||||||
clSettings.insist = true
|
clSettings.insist = true
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
@ -4684,7 +4688,10 @@ function runner.configure( args, monitors )
|
||||||
logfile =
|
logfile =
|
||||||
{
|
{
|
||||||
1,
|
1,
|
||||||
function( file )
|
function
|
||||||
|
(
|
||||||
|
file
|
||||||
|
)
|
||||||
clSettings.logfile = file
|
clSettings.logfile = file
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
@ -4692,16 +4699,21 @@ function runner.configure( args, monitors )
|
||||||
monitor =
|
monitor =
|
||||||
{
|
{
|
||||||
-1,
|
-1,
|
||||||
function( monitor )
|
function
|
||||||
if not monitor then
|
(
|
||||||
|
monitor
|
||||||
|
)
|
||||||
|
if not monitor
|
||||||
|
then
|
||||||
io.stdout:write( 'This Lsyncd supports these monitors:\n' )
|
io.stdout:write( 'This Lsyncd supports these monitors:\n' )
|
||||||
for _, v in ipairs(Monitors.list) do
|
for _, v in ipairs( Monitors.list )
|
||||||
io.stdout:write(' ',v,'\n')
|
do
|
||||||
|
io.stdout:write( ' ', v, '\n' )
|
||||||
end
|
end
|
||||||
|
|
||||||
io.stdout:write('\n')
|
io.stdout:write('\n')
|
||||||
|
|
||||||
lsyncd.terminate(-1)
|
lsyncd.terminate( -1 )
|
||||||
else
|
else
|
||||||
clSettings.monitor = monitor
|
clSettings.monitor = monitor
|
||||||
end
|
end
|
||||||
|
@ -4711,7 +4723,8 @@ function runner.configure( args, monitors )
|
||||||
nodaemon =
|
nodaemon =
|
||||||
{
|
{
|
||||||
0,
|
0,
|
||||||
function( )
|
function
|
||||||
|
( )
|
||||||
clSettings.nodaemon = true
|
clSettings.nodaemon = true
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
@ -4719,7 +4732,10 @@ function runner.configure( args, monitors )
|
||||||
pidfile =
|
pidfile =
|
||||||
{
|
{
|
||||||
1,
|
1,
|
||||||
function( file )
|
function
|
||||||
|
(
|
||||||
|
file
|
||||||
|
)
|
||||||
clSettings.pidfile=file
|
clSettings.pidfile=file
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
@ -4727,44 +4743,52 @@ function runner.configure( args, monitors )
|
||||||
rsync =
|
rsync =
|
||||||
{
|
{
|
||||||
2,
|
2,
|
||||||
function( src, trg )
|
function
|
||||||
clSettings.syncs = clSettings.syncs or { }
|
(
|
||||||
table.insert(
|
src,
|
||||||
clSettings.syncs,
|
trg
|
||||||
{ 'rsync', src, trg }
|
|
||||||
)
|
)
|
||||||
|
clSettings.syncs = clSettings.syncs or { }
|
||||||
|
table.insert( clSettings.syncs, { 'rsync', src, trg } )
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
rsyncssh =
|
rsyncssh =
|
||||||
{
|
{
|
||||||
3,
|
3,
|
||||||
function( src, host, tdir )
|
function
|
||||||
clSettings.syncs = clSettings.syncs or { }
|
(
|
||||||
table.insert(
|
src,
|
||||||
clSettings.syncs,
|
host,
|
||||||
{ 'rsyncssh', src, host, tdir }
|
tdir
|
||||||
)
|
)
|
||||||
|
clSettings.syncs = clSettings.syncs or { }
|
||||||
|
|
||||||
|
table.insert( clSettings.syncs, { 'rsyncssh', src, host, tdir } )
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
direct =
|
direct =
|
||||||
{
|
{
|
||||||
2,
|
2,
|
||||||
function( src, trg )
|
function
|
||||||
clSettings.syncs = clSettings.syncs or { }
|
(
|
||||||
table.insert(
|
src,
|
||||||
clSettings.syncs,
|
trg
|
||||||
{ 'direct', src, trg }
|
|
||||||
)
|
)
|
||||||
|
clSettings.syncs = clSettings.syncs or { }
|
||||||
|
|
||||||
|
table.insert( clSettings.syncs, { 'direct', src, trg } )
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
version =
|
version =
|
||||||
{
|
{
|
||||||
0,
|
0,
|
||||||
function( )
|
function
|
||||||
|
( )
|
||||||
io.stdout:write( 'Version: ', lsyncd_version, '\n' )
|
io.stdout:write( 'Version: ', lsyncd_version, '\n' )
|
||||||
|
|
||||||
os.exit( 0 )
|
os.exit( 0 )
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
@ -4841,9 +4865,7 @@ function runner.configure( args, monitors )
|
||||||
|
|
||||||
os.exit( -1 )
|
os.exit( -1 )
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
if #nonopts == 0
|
if #nonopts == 0
|
||||||
then
|
then
|
||||||
runner.help( args[ 0 ] )
|
runner.help( args[ 0 ] )
|
||||||
|
@ -4856,7 +4878,6 @@ function runner.configure( args, monitors )
|
||||||
|
|
||||||
os.exit( -1 )
|
os.exit( -1 )
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user