[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bacula-devel] FileSet refactoring mockup (was: Re: Bacula Status)

* Martin Simmons schrieb am 07.10.08 um 13:23 Uhr:
> >>>>> On Tue, 7 Oct 2008 07:37:36 +0200, Kern Sibbald said:
> > 
> > 
> > I personally don't find it that confusing, but am willing to admit that some 
> > would.  So, what is the solution?   
> > 
> > Drop the feature?
> > 
> > Change the feature?
> Putting it outside the Include option and making it truely apply to the whole
> fileset would at least make it easier to define what it does.
> > If it involves programming, please realize that this is contributed code, and 
> > so any changes would have to be agreed on by some sort of consensus, and then 
> > done by someone other than the developers or perhaps by the author.
> I think the fileset syntax needs a complete overhaul.  

I thought about this some time now. Conclusion: The current
FileSet{} Syntax is good, but IMO with some changes/improvements
it would be much more logical and easier to understand.

So I did a bit of a "Mockup" what I think how the FileSet would be
better structured maintaining the same flexibility:

Some definitions (many apply to the current syntax):

 * There are two possible sections in "FileSet": "Include" and "Exclude"
   There can be one or more Include and zero or one Exclude
 * NEW: FileWild and FileRegex, not only File can be used to select
   files in Include and Exclude
 * All files matching one of the File* statements will be included into or
   excluded from the backup accordingly.
 * Any File/FileRegex/FileWild statements can begin with a "!" to
   negate it.
 * What will be backed up or not can never be controlled from within
   an "Options" section.
 * Options sections will always only set/change parameters of
   files being selected for that particular include statement.

# Example fileset with comments:
FileSet {
  Name = "MyFileSet"

  Ignore FileSet Changes = <yes|no> # no change
  Enable VSS = <yes|no>             # no change

  Include {        # include /dev/sdf raw with sparse option

    Options {      # this option matches all File* statements
      Sparse = YES # within this Include statement

    File = "/dev/sdf"

  # include some dirs, SHA1 for every file,
  # compress all files not matching ".*\.(gz|bz2|tgz|tbz2)"
  Include {
    Options {            # this option matches all File* statements
      Signature   = SHA1 # within this Include statement

    # compress all files in this include section
    # _not_ matching ".*\.(gz|bz2|tgz|tbz2)"
    Options {
      WildRegex      = !".*\.(gz|bz2|tgz|tbz2)"
      Compression = GZIP
    File      = "/"             # begin at root, stay in FS
    File      = "/usr"          # additional FS mounted on /usr
    FileWild  = "/lib*"         # include /lib, /lib32, /lib64, ...
    FileWild  = "/usr/lib*"     # include /usr/lib, /usr/lib64, ...
    FileRegex = "/home/[a-f]*"  # include all home dirs beginning
                                # with one of a,b,c,d,e,f

  # exclude some of the previous selected files that we do not want
  # to backup:
  # everything in /tmp and every cache dir in user home dirs
  # this applies to any files that matched previously because this
  # section is at the end and thus processesd when!
  Exclude {
    File = /tmp
    FileRegex = "/home/*/[Cc]ache"

Comments please!

8AAC 5F46 83B4 DB70 8317  3723 296C 6CCA 35A6 4134

This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
Bacula-devel mailing list

This mailing list archive is a service of Copilotco.