Bacula-users

Re: [Bacula-users] fileset which only compresses files which are not already compressed like gzip, jpeg, mpeg

2015-08-26 02:59:29
Subject: Re: [Bacula-users] fileset which only compresses files which are not already compressed like gzip, jpeg, mpeg
From: Luc Van der Veken <lucvdv AT wimionline DOT com>
To: "Bacula-users AT lists.sourceforge DOT net" <bacula-users AT lists.sourceforge DOT net>
Date: Wed, 26 Aug 2015 06:53:46 +0000

Hi Ana,

 

Won’t your solution exclude compressed files, instead of including them without a second round of compression?

I think if it can be done, what the OP asked, the right approach would be closer to his own, just using ‘RegexFile’ instead of ‘RegexDir’.

 

I would have tried something like this (untried, untested, probably wrong):

 

Fileset {

                Name = “FullSet

                Include {

                               Options {

                                               RegexFile = regex_for_uncompressed_files

                                               Exclude = yes

                               }

                Options {

                                               Compression = gzip

                               RegexFile = regex_for_compressed_files

                               Exclude = yes

}

File = /

}

}

 

A bit of De Morganized Boolean logic should circumvent the problem that all files not matched by any Options directive are included by default.

The first Options will exclude all uncompressed files – meaning include all compressed, and back them up without compression.

The second will exclude all compressed files – meaning include all uncompressed ones, and back them up with compression.

 

 

From: Ana Emília M. Arruda [mailto:emiliaarruda AT gmail DOT com]
Sent: 25 August 2015 19:50
To: Martin Feldbacher <martin.feldbacher AT stegbauer DOT info>
Cc: Bacula-users AT lists.sourceforge DOT net
Subject: Re: [Bacula-users] fileset which only compresses files which are not already compressed like gzip, jpeg, mpeg

 

Hello Martin,

 

FileSet {
  Name = "Full Set"
  Include {
     Options {
          compression = gzip
     }
     Options {

           RegexFile = "\.[gG]?[zZ][iI][pP]"

           RegexFile = "\.[jJ][pP][eE]?[gG]"

          exclude = yes          

     }
     File = /
  }
}

 

This should work.

 

Best regards,

Ana

 

On Tue, Aug 25, 2015 at 11:10 AM, Martin Feldbacher <martin.feldbacher AT stegbauer DOT info> wrote:

Hello,

 

I'm searching help with a fileset which only compresses files which are not already compressed (like gzip,jpeg,mpeg and so on) in my whole root directory..

my first idea was the following:

 

 

FileSet {
  Name = "Full Set"
  Include {
     Options {
          RegexDir = regex for all files with ending .gzip, .zip, .jpeg, and so on
     }
     Options {
          RegexDir = inverted regex from above, don't know if this works

          compression = gzip
     }
     File = /
  }
}

 

but then I saw the examples at http://www.bacula.org/5.2.x-manuals/en/main/main/Configuring_Director.html so that this doesn't work..

 

does anybody have an idea how to solve this without creating two filesets for one client?

 

thankfull for any help,

 

greets

martin

 


------------------------------------------------------------------------------

_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

 

------------------------------------------------------------------------------
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users