RunScript not working if within multipe JobDefs

27 views
Skip to first unread message

Martin Krämer

unread,
Apr 4, 2020, 9:15:00 AM4/4/20
to bareos-users
Hi All,

I just experienced that if I use multiple (>1) jobdefs in a "subtree" like style the "RunScript" directive does not work.
Is this a wanted behavior or should I debug further and possibly open a bug report?

What I am experiencing is like the following:
There is job A referencing JobDefA which refrences JobDevB.
As long as JobDefA contains my RunScript everything works as expected.
If I move my RunScript to JobDefB it is no longer executed (no error or something - just like bareos cannot "see" it.

Thanks for any feedback in advance.

Script working:
Job {
   Name = 'JobA'
   ...
   JobDefs = 'JobDefA'
}

JobDefs {
  Name = 'JobDefA'
  JobDefs = 'JobDefB'
  ...
  RunScript {
     RunsWhen = Before
     RunsOnClient = Yes
     Command = "MyCommand"
  }
}

JobDefs {
  Name = 'JobDefB'
  ...
}

 Script not working:
 Job {
   Name = 'JobA'
   ...
   JobDefs = 'JobDefA'
}

JobDefs {
  Name = 'JobDefA'
  JobDefs = 'JobDefB'
  ...
}

JobDefs {
  Name = 'JobDefB'
  ...
  RunScript {
     RunsWhen = Before
     RunsOnClient = Yes
     Command = "MyCommand"
  } 
}

Frank Ueberschar

unread,
Apr 6, 2020, 12:45:44 PM4/6/20
to bareos...@googlegroups.com

Using nested Jobdefs is possible, but not recommended:

First, it is undefinded behaviour how RunScripts get overwritten (or even cascaded).

Second, someone gets easy to configure a recursion and this cannot be solved automatically.

Therefore, this is not a bug. The intended behaviour in some future release would be to not allow nested jobdefs.


Am 04.04.20 um 15:15 schrieb Martin Krämer:
--
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 bareos-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bareos-users/cf8ef18d-272f-472d-b6e5-2f95410a514d%40googlegroups.com.
-- 
Mit freundlichen Grüßen

 Frank Ueberschar                          frank.ue...@bareos.com
 Bareos GmbH & Co. KG                      Phone: +49 221 63 06 93-88
 http://www.bareos.com                     Fax:   +49 221 63 06 93-10

 Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
 Geschäftsführer: S. Dühr, M. Außendorf, J. Steffens, P. Storz

ismet...@gmail.com

unread,
Apr 7, 2020, 5:38:52 AM4/7/20
to Frank Ueberschar, bareos...@googlegroups.com, bareos-users...@googlegroups.com

Martin Krämer

unread,
Apr 13, 2020, 2:15:45 AM4/13/20
to bareos-users
Thanks Frank for that information. - So if it is intended behaviour I will deal with it. :)

Never the less l I see Jobdefs as a highly important part of automated backup creations and bulk system management.
Creating a 100 times an individual job seem just a lot of overhead and prone to errors to me.

Furthermore I really hope there will be no such destructive change that will no longer allow nested jobdefs... 
To unsubscribe from this group and stop receiving emails from it, send an email to bareos...@googlegroups.com.
-- 
Mit freundlichen Grüßen

 Frank Ueberschar                          frank.u...@bareos.com
Reply all
Reply to author
Forward
0 new messages