patrickpeng2091 / lsyncd

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

lsyncd does not sync permissions and ownership #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
======================================

 [host A]$ touch 123
 [host A]$ ll
 -rw-r--r-- 1 root  root     0 Aug 13 12:38 123

 [host B]$ ll
 -rw-r--r-- 1 root  root     0 Aug 13 12:38 123

 [host A]$ chown cf 123
 [host A]$ ll
 -rw-r--r-- 1 cf    root     0 Aug 13 12:38 123

 [host B]$ ll
 -rw-r--r-- 1 root  root     0 Aug 13 12:38 123

 [host A]$ chmod +x 123
 [host A]$ ll
 -rwxr-xr-x 1 cf    root     0 Aug 13 12:38 123

 [host B]$ ll
 -rw-r--r-- 1 root  root     0 Aug 13 12:38 123

What is the expected output? What do you see instead?
=====================================================

I expected preserved permissions and ownerships.

What version of the product are you using? On what operating system?
====================================================================

# cat /etc/redhat-release 
CentOS release 5.3 (Final)

# rsync --version
rsync  version 2.6.8  protocol version 29

# lsyncd --version
Version: 1.25

Is there any option to set the expected behavior?

Original issue reported on code.google.com by a...@gmx.de on 13 Aug 2009 at 11:44

GoogleCodeExporter commented 9 years ago
Btw: Creating another executable 

# cat /usr/bin/rsyncop 
#!/bin/bash
/usr/bin/rsync -op $*
exit 0

and using lsyncd with --binary /usr/bin/rsyncop solves the problem. But it's an 
ugly
hack.

Original comment by a...@gmx.de on 13 Aug 2009 at 12:02

GoogleCodeExporter commented 9 years ago
Hi,

on line 759 of lsyncd.c I added this.

IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | IN_CREATE |

and on line 1136 I changed this.

        //if ((IN_CREATE | IN_CLOSE_WRITE | IN_DELETE | 
to
        if ((IN_CREATE | IN_CLOSE_WRITE | IN_DELETE | IN_ATTRIB | IN_MODIFY |

now it also reacts to chmod and chown.

Kind regards,

jessec

Original comment by robertje...@gmail.com on 25 Oct 2009 at 10:56

GoogleCodeExporter commented 9 years ago

if you change in your config file.

    <option text="-lt%r"/>
to 
    <option text="-lopgt%r"/>

permissions work ok.

Kind regards,

jessec

Original comment by robertje...@gmail.com on 25 Oct 2009 at 11:30

GoogleCodeExporter commented 9 years ago

Original comment by axk...@gmail.com on 11 Jul 2010 at 7:04