ayourtch / lsyncd

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

Excluding-Problems #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I just can't make the "exclude-from"-option work.

I created a file /etc/ha-lsyncd.exclude containing all directories I want
to leave unsynchronized.

I tried
(a) <absolut path of directory i don't want to be mirrored>
(b) <relativ path compared to original directory>
(c) RSYNC syntax: "- <path>"

but when I start lsyncd with
 # lsyncd --exclude-from /etc/ha-lsyncd.exclude
the excluded directories are still in sync. What is the correct syntax for
that file?

Original issue reported on code.google.com by a...@gmx.de on 26 Aug 2009 at 5:24

GoogleCodeExporter commented 9 years ago
Hi,

Maybe this is of use.

http://linux.byexamples.com/archives/305/filter-what-to-backup-with-rsync/

Original comment by robertje...@gmail.com on 24 Oct 2009 at 10:20

GoogleCodeExporter commented 9 years ago
I have the same problem. Using the default rsync --exclude-from 
exclude-files.txt
works perfect, using lsyncd --exclude-from exclude-files.txt it seams to be 
ignored.
Any idea why?

System:
fedora 11 
lsyncd 1.26

Original comment by npissa...@gmail.com on 2 Nov 2009 at 3:27

GoogleCodeExporter commented 9 years ago
Hi,
I took a shoot at the source looking for the cause of the problem, and I found 
out
that when passing the arguments to rsync the dir_conf->exclude_file is always 
equals
to NULL. I don't know the cause of this problem but a quick workaround is to 
force
the dir_conf->exclude_file to the file path and it works. This is not a 
permanent
solution to the problem. If and when I have the time I will try to find the 
cause of
the problem, should be a small mistake.

System:
fedora 11 
lsyncd 1.26

Best regards,
NP

Original comment by npissa...@gmail.com on 2 Nov 2009 at 9:38

GoogleCodeExporter commented 9 years ago
Hi again,

Here is my suggestion for a simple fix, in lsyncd.c  line 665 and 669 replace
"dir_conf->exclude_file"  for  "default_exclude_file" and it should work fine.

System:
fedora 11 
lsyncd 1.26

Best regards,
NP

Original comment by npissa...@gmail.com on 3 Nov 2009 at 2:30

GoogleCodeExporter commented 9 years ago
To  npissarra,

I exchange the lsyncd.c in line 665 and 669,but it doesn't work fine.
linux centos 5.4

Michael Field

Original comment by field2...@gmail.com on 29 Mar 2010 at 10:37

GoogleCodeExporter commented 9 years ago
It appears that lsyncd is not properly passing the --exclude-from to rsync, 
while my
C is rusty, here's a quick patch that works:

--- lsyncd-1.26/lsyncd.c        2009-01-05 06:39:41.000000000 -0700
+++ lsyncd-1.26.new/lsyncd.c    2010-03-31 13:58:16.000000000 -0700
@@ -662,11 +662,14 @@
                case CO_EXCLUDE :
                    // --exclude-from and the exclude file
                    // insert only when the exclude file is present otherwise skip it.
-                       if (dir_conf->exclude_file == NULL) {
+                       if (default_exclude_file == NULL) {
                                continue;
                        }
                        argv[argc++] = s_strdup("--exclude-from");
-                       argv[argc++] = s_strdup(dir_conf->exclude_file);
+                       argv[argc++] = s_strdup(default_exclude_file);
t (debug 2)");
                        continue;
                case CO_SOURCE :
                        argv[argc++] = s_strdup(src);

Original comment by bpira...@gmail.com on 1 Apr 2010 at 1:14

GoogleCodeExporter commented 9 years ago
I suppose this was fixed with 1.33?

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

GoogleCodeExporter commented 9 years ago
Looks like excludeFrom nor exclude in Lua configuration file don't work in 
2.0.1.
I haven't tested in older versions.
Can you please confirm it's a bug ?
Thanks.

Original comment by golg...@gmail.com on 17 Jan 2011 at 7:40

GoogleCodeExporter commented 9 years ago
Since if this is sure a new bug as the code base changed completly since 1.33. 
Please open a new bug with more details, what is your exclude file, and what is 
your config file.

Original comment by axk...@gmail.com on 17 Jan 2011 at 9:51