Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

JobDefs that reference another JobDefs

25 views
Skip to first unread message

Jon Schewe

unread,
Oct 23, 2024, 2:34:10 PM10/23/24
to bareos-users
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

Bruno Friedmann (bruno-at-bareos)

unread,
Oct 24, 2024, 4:55:07 AM10/24/24
to bareos-users
Hi Jon, yes a JobDefs can reference a JobDefs see 
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 ;-)

Jon Schewe

unread,
Oct 24, 2024, 1:32:42 PM10/24/24
to bareos-users
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.

Bruno Friedmann (bruno-at-bareos)

unread,
Oct 28, 2024, 6:45:19 AM10/28/24
to bareos-users
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...

Jon Schewe

unread,
Oct 28, 2024, 4:57:01 PM10/28/24
to bareos-users
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.
level3.conf
test-job.conf
level2.conf
level1.conf
Reply all
Reply to author
Forward
0 new messages