axkibe/lsyncd — Issue #41: Exclude doesn't work with rsyncssh
Author: axkibe
Created: 2011-11-16 15:02:21+00:00
State: open

Originally filed by golg...@gmail.com on 2011-01-17T20:30:05

Hi,

Here is my lsyncd.conf :

settings = {
logfile = "/home/toto/log/lsyncd.log",
statusFile = "/home/toto/log/lsyncd.status",
}

sync{
default.rsyncssh,
source = "/home/src/example",
host = "192.168.1.100",
targetdir = "/home/dest/example",
exclude = {"//home/src/example/tmp/**"}
}

Launched with :

> lsyncd -nodaemon -log all etc/lsyncd.conf

I get :

Exclude: toLuaPattern '//home/src/example/tmp/**' = '^/home/src/example/tmp/.*"

So the pattern looks ok (although I'd suggest let people use real Lua regex patterns, it will make easier for everybody, and allow more possibilities. The translation from your pseudo patterns to Lua patterns is unnecessary in my opinion).

21:13:23 Function: Inotify.addWatch(/home/src/example/tmp/, (true), (nil), (nil))
21:13:23 Inotify: not concerning '/home/src/example/tmp/'

So pattern seems to work. But it is not used in the rsync command :

21:13:23 Exec: /usr/bin/rsync [--delete] [-r] [-lts] [/home/src/example/] [192.168.1.100:/home/dest/example/]

And I get many :

rsync: send_files failed to open "/home/src/example/tmp/sessions/sess_1234": Permission denied (13)

Although I told the conf to ignore this directory.

Am I doing something wrong or is this a bug ?
Do i have to add something specific for the rsync command ? The -exclude-from doesn't seem to exist anymore.

Thanks in advance :)