Hello Phil, Arno, Martin,

On Thu, 02 Feb 2006 02:02:02 -0800
[EMAIL PROTECTED] wrote:

> > To catch ALL dotfiles in Bacula, where . and .. are not concerns,
> > one could simply use the following regex:
> > 
> > '^\..*'
> > 
> > which would denote any filename beginning with a literal . followed
> > by zero or more additional characters.
> > 
> > In a more general environment where . and .. are concerns
> 
> Just to clarify this, and after a short look int the manual, is it 
> correct that Bacula doesn't match directory names against RegExFile 
> patterns? In that case, the REs would definitely become much
> simpler...
> 
> > and we don't
> > want recursive selection of current and parent directories, the
> > problem is more complex.  We want to accept filenames beginning
> > with a dot and having at least one additional character, with the
> > restriction that the second character may not also be a dot.  That
> > would look something like this:
> > 
> > '^\.([^.]|\..).*$'
> > 
> > Note that there is NOT a \ escaping the . in the bracket expression.
> 
> Thanks. I was sure I missed something.
> 
> > This is because matching rules are different within POSIX bracket
> > expressions.  Quoting from regex.3:
> > 
> >        To  include  a  literal `]' in the list, make it the first
> >        character (following a possible `^').  To include  a  lit-
> >        eral `-', make it the first or last character, or the sec-
> >        ond endpoint of a range.  To use  a  literal  `-'  as  the
> >        first  endpoint of a range, enclose it in `[.' and `.]' to
> >        make it a collating element (see below).  With the  excep-
> >        tion  of  these  and some combinations using `[' (see next
> >        paragraphs), all other special characters, including  `\',
> >        lose  their  special significance within a bracket expres-
> >        sion.
> > 
> > The important part of that, for our purpose, is the last sentence,
> > because it means that within a [] pair, a \ is just a \, a . is
> > just a ., a psi is just a psi[1].  So not only is it impossible to
> > escape the dot within a bracket expression but, fortunately, we
> > don't need to.
> > 
> > So, the above expression can be read as thus:
> > 
> > ^\.    Match anything which begins with a literal .
> > (      followed by EITHER
> > [^.]   a character which is not a literal .
> > |\..   OR a second literal . followed by ANY character
> > )      (end of the EITHER-OR part)
> > .*     followed by ANY ZERO OR MORE additional characters
> > $      and then ends.
> 
> Great. And now, put that into the manual :-)

I can second that! With the help of you I finally managed to solve my
problem. 

The upcoming about the dot-files is that my $HOME is quite huge and
the data insode the $HOME changes on a daily basis and is not "very"
important. Relevant data is mounted somewhere else. (and is backed up
by another job). I just want to copy the user-env configuration files.

THanks again.

        Stephan

> 
> > 
> > [1]  It'll all become clear, as time goes by.
> 
> Too true... but I'm always astonished how much time and experience
> you need to get REs done... the differences between POSIX REs, Perl
> REs and what sed and awk expect add additional spice to that.

-- 
GDF Hannover - Solutions for spatial data analysis and remote sensing
Hannover Office      -     Mengendamm 16d      -     D-30177 Hannover
Internet: www.gdf-hannover.de      -      Email: [EMAIL PROTECTED]
Phone : ++49-(0)511.39088507       -        Fax: ++49-(0)511.39088508


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to