Attached you will find 3 JobDefs files that refer to each other in a chain.
You will also find a test job. When test-job refers to level3 JobsDefs the
output of loading the configuration is:
*reload
failed to reload
You have messages.
*messages
28-Oct 16:54 bareos-dir JobId 0: Error: "Type" directive in Job "test-job"
resource is required, but not found.
28-Oct 16:54 bareos-dir JobId 0: Error: Please correct the configuration in
/etc/bareos/bareos-dir.d/*/*.conf
28-Oct 16:54 bareos-dir JobId 0: Error: Resetting to previous configuration.
When test-job refers to level2 JobDefs everything is fine.
On Monday, October 28, 2024 at 5:45:19 AM UTC-5 Bruno Friedmann
(bruno-at-bareos) wrote:
> Hi at least you want want to expose first a simple case here.
> How you think you should work with example, and the problem you're
> experimenting...
>
>
>
> On Thursday 24 October 2024 at 19:32:42 UTC+2 Jon Schewe wrote:
>
>> OK, then I should file a bug report if I am finding that multiple levels
>> of JobDefs aren't working? My top level JobDefs has the backup type
>> specified and if I have a Job reference a JobDefs 2 levels down from the
>> top I get an error from bareos that the backup type is not specified.
>>
>> On Thursday, October 24, 2024 at 3:55:07 AM UTC-5 Bruno Friedmann
>> (bruno-at-bareos) wrote:
>>
>>> Hi Jon, yes a JobDefs can reference a JobDefs see
>>>
>>> https://docs.bareos.org/bareos-23/Configuration/Director.html#config-Dir_Job_JobDefs
>>> but also take into account the restriction about some parameter that
>>> will not be replaced but added ;-)
>>>
>>> I personally prefer to have dedicated jobdefs with only one level to
>>> simplify the human comprehension of the configuration ;-)
>>> On Wednesday 23 October 2024 at 20:34:10 UTC+2 Jon Schewe wrote:
>>>
>>>> I found that I can have a Job reference a JobDefs defs1 and that
>>>> reference JobDefs defs2 and that appears to work.
>>>> However having a Job reference JobDefs defs1 which references JobDefs
>>>> defs2 which references JobDefs defs3.
>>>>
>>>> Is it expected that a JobDefs can reference another JobDefs?
>>>> If yes, is it expected that nesting more than 1 level doesn't work?
>>>>
>>>> Having this nesting is handy to avoid duplicating configuration data,
>>>> however I understand that this may be hard to implement.
>>>>
>>>>
>>>> Jon
>>>>
>>>>
--
You received this message because you are subscribed to the Google Groups
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/bareos-users/34b6a339-5d08-4105-b740-28e009b95a78n%40googlegroups.com.
JobDefs {
Name = "level3"
JobDefs = "level2"
Schedule = "WeeklyCycle"
Storage = onsite-file
# going to file, no need to spool
Spool Data = no
Always Incremental = yes
Always Incremental Job Retention = 7 days
Always Incremental Keep Number = 14
Always Incremental Max Full Age = 35 days
}
Job {
Name = "test-job"
JobDefs = "level3"
Client = "bareos-fd"
FileSet = "LinuxAll"
}
JobDefs {
Name = "level2"
JobDefs = "level1"
Schedule = "WeeklyCycle"
Storage = onsite-file
Pool = onsite-file-Incremental
Full Backup Pool = onsite-file-Consolidated
# going to file, no need to spool
Spool Data = no
}
JobDefs {
Name = "level1"
Type = Backup
Level = Incremental
Messages = Standard
Write Bootstrap = "/var/lib/bareos/%c.bsr"
Priority = 30
Rerun Failed Levels = yes
Accurate = yes
Spool Data = yes
}