Bacula-users

Re: [Bacula-users] regex strangeness with Windows filesets

2008-05-14 06:13:12
Subject: Re: [Bacula-users] regex strangeness with Windows filesets
From: Martin Simmons <martin AT lispworks DOT com>
To: bacula-users AT lists.sourceforge DOT net
Date: Wed, 14 May 2008 11:12:58 +0100
>>>>> On Tue, 13 May 2008 16:33:57 -0400, Frans Lawaetz said:
> 
> >
> > Indeed, I think that is the reason it didn't work for the OP.  The regex
> > ".*doc" will match anything containing "doc", including
> > C:\Documents and Settings\foo.
> >
> > The correct usage is with two backslashes (because of the quotes) and 
> > a dollar
> > at the end, i.e.
> >
> > regexfile = ".*\\.doc$"
> >
> > However, it is simpler to use wildfile in this this case:
> >
> > wildfile = "*.doc"
> >
> I had tried that previously to no avail.  At the moment it looks like 
> the "first match" logic in fileset processing is not working correctly 
> with WindowsXP.  My config below generates zero matching files or 
> directories when an "estimate listing" is run via bconsole.  When I 
> comment the first "regexfile" directive in the Exclude list it starts 
> matching all files and directories not covered by the WildDir entries.  
> Unless I am missing something, this behavior is counter to the Bacula guide.
> Note that I do have .doc files in a subdirectory of "c:/Documents and 
> Settings/test"
> 
> FileSet {
>  Name = "WinClient"
>  Include {
>   Options {
>    signature = MD5
>    compression = GZIP3
>    IgnoreCase = yes
>    Wildfile = "*.doc"
>    }
>   }
> 
>  Exclude{
>   Options {
>   # Exclude = yes
>    IgnoreCase = yes
>    regexfile = ".*"
>    wildfile = ".*mp3"
>    WildDir = "c:/Documents and Settings/Administrator"
>    WildDir = "c:/Documents and Settings/NetworkService"
>    WildDir = "c:/Documents and Settings/All Users"
>    WildDir = "c:/Documents and Settings/Default User"
>    WildDir = "c:/Documents and Settings/LocalService"
>    WildDir = "c:/Documents and Settings/*/Application Data"
>    WildDir = "c:/Documents and Settings/*/LocalService"
>    WildDir = "c:/Documents and Settings/*/Contacts"
>    WildDir = "c:/Documents and Settings/*/Start Menu"
>    WildDir = "c:/Documents and Settings/*/Windows"
>    WildDir = "c:/Documents and Settings/*/\..*"
>    WildDir = "c:/Documents and Settings/*/nethood"
>    WildDir = "c:/Documents and Settings/*/My Documents"
>    WildDir = "c:/Documents and Settings/*/printhood"
>    WildDir = "c:/Documents and Settings/*/LocalService"
>    # RegexDir = "/Documents and Settings/*"
>   }
>   File = "c:/Documents and Settings"
>  }
> }

Arno is right: you need to use a single Include clause, with multiple Options
clauses.  Put Exclude=yes into the Options clause where you want to define the
excludes.

Also, perhaps you edited the above since you last tested it, because it
doesn't make sense to me.  Firstly, it has no useful File= directives (the
only one is inside the Exclude) so won't match anything anyway.  Secondly,
Bacula completely ignores regexfile, wildfile and WildDir options inside the
Exclude { ... } clause, so changing them will not make any difference.

__Martin

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users