regex + sbackup

Darryl Clarke smartssa at gmail.com
Wed Feb 15 04:38:11 UTC 2006


On 14/02/06, dave s <ubuntu at pusspaws.net> wrote:
> On Wednesday 15 Feb 2006 02:02, Darryl Clarke wrote:
> >
> > Wait, is the data path:
> > /home/dave/test/something/data
> > or
> > /home/dave/test/data?
>
> Yep Its this one
>
> >
> > If it's the second, it's no wonder it didn't work ;)
> >
> > try:
> > /home/dave/[^/]+?/data
>
> :) that works !
>
> >
> > this will exclude
> > /home/dave/[anything]/data
> > but not
> > /home/dave/data
> > or
> > /home/dave/[anything]/[something]/data
> >
>
> because [^/]+?/ replaces one element in the path :)
>
> > I think this:
> > /home/dave/[.]+?/data
> >
> > should exclude
> > /home/dave/[anything/including/subfolders]/data
> >
> > but still not
> > /home/dave/data
> >
>
> I see what you are saying
>
> > I don't think you're experiencing a bug, just some regex trickery.
> >
>
> This regex stuff is a dark art. I got the path thing now and it works ( a big
> thank you :)) but I still have one last regex problem.
>
>  /home/dave/[^/]+?/data
>
> excludes the data directorys but also my 'data_process' directories :( I
> changed my regex to
>
>  /home/dave/[^/]+?/data$
>
> to try and only exclude 'data' directories but all it did was allow both data
> and data_process directories.
>
> ...mmm...
>
> any ideas on this last one ?

Hmm... that should work. the hardest part of this is knowing how
sbackup is actually comparing.  The fact that the last one doesn't
leads me to believe sbackup compares whole path name with a trailing /

/home/dave/[^/]+?/data/$


--
~ Darryl  ~ smartssa at gmail.com
~ http://darrylclarke.com




More information about the ubuntu-users mailing list