Re: [Bacula-users] Still not getting wildcard matching
> On Fri, 24 Jun 2011 06:52:49 -0600, Stuart McGraw said: > > On 06/23/2011 04:26 AM, Martin Simmons wrote: > >> On Wed, 22 Jun 2011 21:25:24 -0600, Stuart McGraw said: > [...] > >> I have not been seen in the Bacula manual a description of exactly > >> how filenames match wildcard specs (e.g. does "a*b" match "a/b"?). > > > > Yes, that is the problem. "/home/*/.*" matches > > "/home/smcg4191/Maildir/.foo" > > :-( You'll probably have to use regex for that one. > > > >> Is one available somewhere? > > > > Look at man fnmatch. Bacula can pass the FNM_CASEFOLD flag if > > IgnoreCase=yes > > is specified, but that is the only documented option. > > Thanks. > > Sadly, the linux man pages I looked at didn't give any > description of matching semantics but they do say it is > POSIX.2 conformant so it is possible to track down its > behavior that way. > > It looks like Bacula contains its own implementation of > fnmatch so it should be possible for the Bacula documentation > to describe its behavior directly without passing the buck > to the OS docs. The Bacula implementation was taken from OpenBSD, so it should match the doc at http://www.openbsd.org/cgi-bin/man.cgi. > fnmatch has a FNM_PATHNAME option that will cause "*" et.al. > not to match slashes. Has there ever been consideration given > to allowing some form of Wild* directive that would use that > option? It seems like that would have solved my problem and > make many FileSet rules more intuitive. The current matching > rules make it pretty easy to exclude more than one intended. There is an old undocumented option "Enhanced Wild = yes" that passes FNM_PATHNAME but noone seems to know what it's real purpose was (it used to use a completely different implementation of fnmatch). I recommend using regexs for these cases. __Martin -- All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] Still not getting wildcard matching
On 06/23/2011 04:26 AM, Martin Simmons wrote: >> On Wed, 22 Jun 2011 21:25:24 -0600, Stuart McGraw said: [...] >> I have not been seen in the Bacula manual a description of exactly >> how filenames match wildcard specs (e.g. does "a*b" match "a/b"?). > > Yes, that is the problem. "/home/*/.*" matches "/home/smcg4191/Maildir/.foo" > :-( You'll probably have to use regex for that one. > >> Is one available somewhere? > > Look at man fnmatch. Bacula can pass the FNM_CASEFOLD flag if IgnoreCase=yes > is specified, but that is the only documented option. Thanks. Sadly, the linux man pages I looked at didn't give any description of matching semantics but they do say it is POSIX.2 conformant so it is possible to track down its behavior that way. It looks like Bacula contains its own implementation of fnmatch so it should be possible for the Bacula documentation to describe its behavior directly without passing the buck to the OS docs. fnmatch has a FNM_PATHNAME option that will cause "*" et.al. not to match slashes. Has there ever been consideration given to allowing some form of Wild* directive that would use that option? It seems like that would have solved my problem and make many FileSet rules more intuitive. The current matching rules make it pretty easy to exclude more than one intended. -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense.. http://p.sf.net/sfu/splunk-d2d-c1 ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] Still not getting wildcard matching
> On Wed, 22 Jun 2011 21:25:24 -0600, Stuart McGraw said: > > I am converting FileSets that used mostly used regexes > to use wild matches where possible. But I am still not > getting how wildcard matching is working. > > Options { > Wilddir = "/home/*/.backup" > Wild= "/home/*/.backup/*" > } > Options { > Exclude = yes > Wild= "/home/*/.*" > Wilddir = "/home/*/tmp" > Wilddir = "/home/*/Maildir/.*/tmp" > } > File = /home > > The above FileSet is excluding all /home/*/Maildir/.* files, not > just the .../tmp subset I intended. Why? And how do I fix it? > > I have not been seen in the Bacula manual a description of exactly > how filenames match wildcard specs (e.g. does "a*b" match "a/b"?). Yes, that is the problem. "/home/*/.*" matches "/home/smcg4191/Maildir/.foo" :-( You'll probably have to use regex for that one. > Is one available somewhere? Look at man fnmatch. Bacula can pass the FNM_CASEFOLD flag if IgnoreCase=yes is specified, but that is the only documented option. __Martin -- Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Data protection magic? Nope - It's vRanger. Get your free trial download today. http://p.sf.net/sfu/quest-sfdev2dev ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users