ed00m / lsyncd

Automatically exported from code.google.com/p/lsyncd
GNU General Public License v2.0
0 stars 0 forks source link

rsyncOpts should be able to override "--delete" too #87

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have a setup where I don't want rsyncssh to include the --delete flag by 
default. I thought rsyncOpts could override it but apparently it does not:

sync{default.rsyncssh, source="/foo", host="b5.biotech.kth.se", 
targetdir="/bar", rsyncOpts="-lts"}

$ ps aux | grep rsyncssh
(...)
rsyncssh    27537 59.0  0.0 111712  4552 ?        R    15:26   0:02 
/usr/bin/rsync --delete -r -lts foo machine2:/bar

Is there any way to override the whole rsync options when using rsyncssh ?

Thanks !

Original issue reported on code.google.com by brainc...@gmail.com on 7 Oct 2011 at 1:29

GoogleCodeExporter commented 9 years ago
Currently your only option is to alter lsyncd.lua and remove "--delete" from 
the sync calls in {} default_rsyncssh.

It will be made an command line option in Lsyncd 2.1

Original comment by axk...@gmail.com on 7 Oct 2011 at 2:08

GoogleCodeExporter commented 9 years ago
Your issue has been moved to https://github.com/axkibe/lsyncd/issues

Original comment by axk...@gmail.com on 16 Nov 2011 at 3:58

GoogleCodeExporter commented 9 years ago
I read this

http://groups.google.com/group/lsyncd/browse_thread/thread/2e496738b6cfa9d2

As I am only concerned about default.rsyncssh I modified the code from the 
current source as below

                -- uses ssh to delete files on remote host
                -- instead of constructing rsync filters
                if event.etype == 'Delete' then

                        local elist = inlet.getEvents(
                                function(e)
                                        return e.etype == "Delete"
                                end)

to 

                -- uses ssh to delete files on remote host
                -- instead of constructing rsync filters
                if event.etype == 'Delete' then
                      inlet.discardEvent(event)
                      return

                        local elist = inlet.getEvents(
                                function(e)
                                        return e.etype == "Delete"
                                end)

But on issuing the make command I get the below error.

luac: lsyncd.lua:3358: unexpected symbol near 'local'
make[1]: *** [luac.out] Error 1
make[1]: Leaving directory `/usr/local/src/lsyncd-2.0.5'
make: *** [all] Error 2

Did I miss something here ?

Original comment by jayesh.jayan on 19 Jan 2012 at 6:39