Bacula-users

Re: [Bacula-users] Comments in generated file lists?

2008-07-18 17:11:48
Subject: Re: [Bacula-users] Comments in generated file lists?
From: Arno Lehmann <al AT its-lehmann DOT de>
To: bacula-users AT lists.sourceforge DOT net
Date: Fri, 18 Jul 2008 23:11:01 +0200
Hi,

18.07.2008 18:13, Martin Simmons wrote:
>>>>>> On Fri, 18 Jul 2008 13:57:06 +0200, Arno Lehmann said:
>> Hi,
>>
>> 18.07.2008 13:31, Martin Simmons wrote:
>>>>>>>> On Thu, 17 Jul 2008 22:38:52 +0200, Arno Lehmann said:
>>>> Hi,
>>>>
>>>> 17.07.2008 21:37, Martin Simmons wrote:
>>>>>>>>>> On Thu, 17 Jul 2008 11:59:34 -0400, Patrick LeBoutillier said:
>>>>>> Hi,
>>>>>>
>>>>>> We use the following construct to generate the files we want Bacula to
>>>>>> backup for a specific job:
>>>>>>
>>>>>> FileSet {
>>>>>>         Name = "archiver"
>>>>>>         Include {
>>>>>>                 Options {
>>>>>>                         signature = MD5
>>>>>>                 }
>>>>>>                 File = "\\|sh -c '/root/bin/bacula-filelist.sh %v %i'"
>>>>>>         }
>>>>>> }
>>>>>>
>>>>>> We would like to be able to include comments in the generated file
>>>>>> list because we also save it to a file for processing.
>>>>>> We tried adding a '#' at the beginning of a line but Bacula complains:
...
>>>>>> Is there a supported comment marker for generated file lists?
>>>>> No, you'll have to filter them within the script, e.g. with grep -v.
>>>> Or, alternatively, let your script create a list of complete File= 
>>>> entries... the include syntax works everywhere, so you can generate 
>>>> output like
>>>>
>>>> # home directories
>>>> File = /home/
>>>> # data
>>>> File = /var/
>>>>
>>>> and so on.
>>> That will only work at config-loading time on the Director machine though, 
>>> so
>>> not with dynamic \| file lists on the client.
>> As far as I know - and can understand from reading the code - "|" 
>> works whenever a configuration file is read or included.
>>
>> I haven't tried it (at least I don't find any notes about it), but I 
>> believe including program output is always possible where you can 
>> include plain text.
> 
> You are thinking of the @"|..." syntax perhaps?  I suspect that is less useful
> here, because it will generate the list when the Director is started (or the
> reload command is used).

Not exactly. Mind you - I haven't tried this, but in reading through 
the code, I believe that, in a fileset include section, you should be 
able to use the pipe to use program output, and this can be done on 
the client. The fileset processing in the FD handles includes starting 
with a pipe.

> 
> Use of | or \| in a File= directive is quite different because it happens when
> the job starts.

Right, that's what I refer to. Unfortunately, that does *not* allow 
comments in the generated file list.

As far as I can see, and where I was wrong with my previos answer, you 
can not have a "normal" include (i.e., one that is outside an 
include/exclude resource) in a file set that is executed on the client.

Or, in other words and shorter - there is neither a comment in a 
generated file list (which is reasonable; files can start with any 
character. It's bad enough you can't have newlines in generated file 
names) nor can you create the complete include section, which would 
allow comment lines, on the client.

Arno

> __Martin
> 
> -------------------------------------------------------------------------
> 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
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Bacula-users mailing list
> Bacula-users AT lists.sourceforge DOT net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
> 

-- 
Arno Lehmann
IT-Service Lehmann
www.its-lehmann.de

-------------------------------------------------------------------------
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
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users