On Saturday 19 March 2005 21:22, David Fuchs wrote:
> Kern Sibbald wrote:
> >Hello,
> >
> >On Friday 18 March 2005 23:56, David Fuchs wrote:
> >>Hello,
> >>
> >> I've been trying to configure a FileSet that will only back up
> >>specific file extensions, but I seem to be misunderstanding the syntax of
> >>the FileSet records.
> >>
> >> By searching the archives, I found the following FileSet example
> >>from someone else in the same situation. In my effort to back up only
> >>certain file extensions (and exclude everything else by default) I came
> >> up with a very similar FileSet definition myself (only I'm specifying
> >> tarballs instead of M$ Office documents):
> >
> >It was probably me who proposed something like the following. I suspect
> > it never worked because contrary to what I thought the exclude = yes
> > matches nothing. So, I have two suggestions that may work:
> >
> >1. Add a
> > wild = "*"
> > just after the exclude = yes
> >
> >2. Alternatively, and probably better, add a
> >
> > regex = ".?*$"
Well, it looks like I made a small typo here (rather my International keyboard
bit me). It should be:
regex = "^.?*$"
However, life is never so simple; even that is wrong. Why? because it
excludes everything even /home/df/test. The correct solution is to use:
RegexFile = "^.?*$"
which excludes all files but not the directories.
So the complete correct FileSet *should* be:
FileSet {
Name = "Test Set"
Include {
Options {
WildFile = *.tar.gz
signature = MD5
compression = GZIP
}
Options {
exclude = yes
RegexFile = "^.?*$"
}
File = /home/df/test
}
}
With the above, Bacula will backup all your *.tar.gz files as well as all the
directories (no files) including and under /home/df/test. It is probably
better to let the directories to be backed up so that if a file is restored,
all the directories leading down to it are also restored with the proper
owners/permissions.
Note, Regex/RegexFile/RegexDir do not work on Win32 systems since it is not in
the Microsoft libraries, and I haven't take the time to dig out the source
code and include it in Bacula.
> >
> > just after the exclude = yes.
> >
> >I would be interested to know if this works or not.
>
> Thank-you for your message Kern. I tried both of your suggestions -
> both seem quite reasonable; however, the first one resulted in no files
> being backed up at all. The regex in the second suggestion produced
> config errors. I changed it to:
>
> regex = ".*"
> and I also tried
> regex = "^.*$"
>
> Though both of these resulted in no files being backed up. I made sure
> to add the wild/regex statements after the exclude = yes, though the
> results were the same no matter where in the Options resource I placed
> them.
>
> It's a curious thing... the wild = * or above regex statements in the
> second Options resource results in no files being backed up at all, yet
> it should not have even read that Options resource with regard to the
> tarballs I'm trying to back up (since those are matched by a previous
> Options Resource). Here is the latest version of my fileset config
> (which currently results in no files being backed up):
>
> FileSet {
> Name = "Test Set"
> Include {
> Options {
> wild = *.tar.gz
> signature = MD5
> compression = GZIP
> }
> Options {
> exclude = yes
> wild = *
> }
> File = /home/df/test
> }
> }
>
> The directory /home/df/test consists of a combination of regular files,
> tarballs (tar.gz), and directories.
>
> >>"An Options resource that does not contain a wild directive is assumed to
> >>match any filename. This is important to understand, because once Bacula
> >>determine that the Options matches the file under consideration, that
> >>file will be saved without looking at any other Options resources that
> >>may be present."
> >
> >This is why I thought the above would work, but I think in fact that the
> > above is wrong. On the other hand, if one drops out of all the Options,
> > and nothing has matched, then everything is matched, and the Options from
> > the last Options are used (but apparently not the exclude -- I'm going to
> > look into this).
>
> Thanks very much Kern, any other suggestions you or anyone else has are
> much appreciated!
>
> -David Fuchs
--
Best regards,
Kern
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users