Martin, you are right, my bad, I overlooked that you were not using RegexDir, 
but Regex for the exclude.

I am very glad that your solution works, thank you so much. I have to admit, on 
that evening I had been mucking around a lot more and also a friend, and none 
of our attempts worked as intended.

So still, I find the definition of filesets very confusing, I hope I will get a 
better understanding through your example.

Thank you again!
 J/C


> On 30. Aug 2022, at 15:44, Martin Simmons <mar...@lispworks.com> wrote:
> 
> The order of the File declarations relative to the Options declarations
> doesn't matter.  However, the order of the Options declarations relative to
> each other does matter (Bacula uses the first Options that matches based on
> RegexDir etc).
> 
> The problem below is that you are using RegexDir instead of Regex in the
> Exclude Options clause.
> 
> __Martin
> 
> 
>>>>>> On Fri, 26 Aug 2022 22:37:08 +0200, Justin Case said:
>> 
>> Martin, thanks, I admit that for me the fileset definition is one of the 
>> more confusing things in Bacula. Thanks for the explanation, however, 
>> honestly, I don’t get it. 
>> 
>> I adapted the fileset according to your proposal, and this is what baculum 
>> makes from it:
>> 
>> Fileset {
>> Name = "test-appdata"
>> EnableVss = no
>> EnableSnapshot = no
>> Include {
>> File = "/home/dockerman"
>> Options {
>> OneFs = "No"
>> RegexDir = "^/home/dockerman/containerdata-"
>> }
>> Options {
>> OneFs = "No"
>> Exclude = "Yes"
>> RegexDir = "^/home/dockerman/[^/]+$"
>> }
>> }
>> 
>> Running this results in actually nearly the same result. The delta of the 
>> outcome are actually 3 files (gleaned form the numbers of the jobs, I don’t 
>> know which files that are). 
>> 
>> Does the order of the declarations (as seen above) have anything to do with 
>> this result?
>> 
>>> On 26. Aug 2022, at 21:24, Martin Simmons <mar...@lispworks.com> wrote:
>>> 
>>>>>>>> On Fri, 26 Aug 2022 20:41:22 +0200, Justin Case said:
>>>> 
>>>> So actually, the fileset did back up the /home/../containerdata.. stuff, 
>>>> but
>>>> also other files outside of /home/,,,/containderdata, which I did not 
>>>> intend
>>>> to happen.
>>>> 
>>>> in the /home/dockerman there are only dot-files sich as .Xauthority and
>>>> .ssh/config Why would those have been backed up by this fileset?
>>>> 
>>>> And then I realized that this was also the case for the compound fileset!
>>>> The fileset does actually back up the containerdata-* folder contents both
>>>> in /home/dockerman and in /mnt. The amount of data in /home is just much
>>>> smaller and in baculum the order of the files shown suggested that files
>>>> other then /home/../containerdata-… were backed up, and the files on
>>>> containerdata couldn’t be seen in the file list.
>>>> 
>>>> Still the same caveat as above holds for the compound fileset, too. I don’t
>>>> understand that.
>>> 
>>> It does that because your fileset definition tells it to :-)
>>> 
>>> The problem is that "^/home/dockerman/.*/" only matches directories two 
>>> levels
>>> below /home/dockerman, such as /home/dockerman/dir1/dir2.  Everything above
>>> that is included, for example directories like /home/dockerman/dir1 and 
>>> files
>>> like /home/dockerman/file1 and /home/dockerman/dir1/file1.
>>> 
>>> I think this does what you want:
>>> 
>>> Include {
>>>   Options {
>>>     OneFs = no
>>>     # override the Exclude for this prefix
>>>     RegexDir = "^/home/dockerman/containerdata-"
>>>   }
>>>   Options {
>>>     OneFs = no
>>>     Exclude = yes
>>>     # disallow all top-level things not explicitly included above
>>>     Regex = "^/home/dockerman/[^/]+$"
>>>   }
>>>   File = "/home/dockerman"
>>> }
>>> 
>>> Note that the paths inside the /home/dockerman/containerdata-... directories
>>> will be included implicitly because they don't match the excluded Regex.  
>>> The
>>> Options (except Exclude) from the last clause will be used for those paths.
>>> 
>>> __Martin
>> 
>> 
> 



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

Reply via email to