Amanda-Users

Re: Use of RegEx in exclude

2007-01-29 09:14:06
Subject: Re: Use of RegEx in exclude
From: Francis Galiegue <fg AT one2team DOT com>
To: amanda-users AT amanda DOT org
Date: Mon, 29 Jan 2007 14:38:44 +0100
Le lundi 29 janvier 2007 13:50, Lars Monsees a écrit :
> Hello,
> 
> I´m quite new to amanda so I have left something out don´t slap me =)
> (I know from the documentation that it is possible to use ?* wildcards.)
> 
> 
> We have a server with several customer domains located at our ISP who 
controls the backup. Therefore, it is only possible for us to define an 
exclude list.
> 
> Each domain has a standard set of directories that I don´t want to be 
included in the backup. The directory structure looks like:
> 
> - domain123.de
>      - anon_ftp
>      - etc
>      - bla
>      - httpdocs
> - anotherdomain.com
>      (same structure as above)
> 
> 
> At the moment, we have the root of all domains in our backup to save the 
httpdocs dir for each domain (also for new domains without adopting 
anything).
> Now, I want to exclude the anon_ftp, etc and bla dir from the backup and 
tried to use a RegEx:
> 
>    ./[A-Za-z0-9._-]*\.[A-Za-z]{2,4}/anon_ftp
> 
> Unfortunately, this doesn´t seem to work. Is there any other way I can 
achieve this?
> 

First: don't forget that the dot in a regex can match any character. Then (I'm 
too lazy to read the docs wrt that matter) you have to know whether the 
regexes to be used apply only in part or as a whole to the directory you mean 
to get excluded - also, whether it is or not relative to the root of the 
filesystem.

Can you try this:

([^/]+/)+/anon_ftp

and see if this works?

Also, you say that this doesn't seem to work. In what sense? Does it exclude 
too much, not enough? Are you sure that the four last chars before anon_ftp 
can never be anything other than letters?

-- 
Francis Galiegue, fg AT one2team DOT com
12bis rue de la Pierre Levée, 75011 PARIS
+33143381980, +33683877875


<Prev in Thread] Current Thread [Next in Thread>