Re: [Bacula-users] python support removal
On Monday 05 November 2007 12:14:51 Rich wrote: > you probably wanted to send this to list ;) > > On 2007.11.05. 13:01, Marek Simon wrote: > > I think some scripting support is good for various hacking and unusual > > solutions, but I think python is kind of "exotical" language. Designed to be easy to read and understand - one good quality for an interface scripting language. > > Very few > > users know it, very few projects is written in it Please try to remove all Python from your Linux box (if you have one) and let's see what's still working? > > and on universities > > it's tought very rarely. Maybe because it is so easy to understand and learn that there is no need for tutoring! > > May be some other language would be appriciate. > > it's not that exotic, actually. you can even write openoffice.org macros > in it :) > > as for the language itself, i can't comment. i don't code, and if i can > configure it for my liking once, that's all i want. oh, and i also want > it not to break on upgrades =) > > > MArek > > ... -- Regards Steen - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] python support removal
I'm not a developer, and have only started to try to teach myself programming (slow going given my time-constraints and other demands on my time) so my $.02 is probably worth $.002 after the exchange-rate, but while reading this thread I thought that it would be "neat" if a bacula API were developed that other languages could "hook" into. That was python, ruby, perl, whatever could be used. Then again, I'm looking at it from a non-programmer viewpoint, so it's "easy for me to say"... so to speak. I wouldn't have to program or document the API. On Tuesday 06 November 2007 4:47:29 pm Ben Beuchler wrote: > On 10/31/07, Rich <[EMAIL PROTECTED]> wrote: > > see > > http://bugs.bacula.org/view.php?id=998 > > > > "After version 2.2.x Python will no longer be support -- there are an > > insufficient number of users." > > Oy vey! > > I am even as we speak working on implementing some Python code to > handle volume labeling! > > -Ben > > - > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > ___ > Bacula-users mailing list > Bacula-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bacula-users -- -- Flak Magnet (Tim) www.flakmagnet.com - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] python support removal
On 10/31/07, Rich <[EMAIL PROTECTED]> wrote: > see > http://bugs.bacula.org/view.php?id=998 > > "After version 2.2.x Python will no longer be support -- there are an > insufficient number of users." Oy vey! I am even as we speak working on implementing some Python code to handle volume labeling! -Ben - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] python support removal
Hello, 06.11.2007 20:44,, Kern Sibbald wrote:: Thanks for clarifying this. > On Monday 05 November 2007 13:12, Arno Lehmann wrote: ... True. But chances might be better to find such a person if python was left in... if we had it in Bacula (as long as possible - Bacula core development might some day get incompatible with how python is embedded today - ) that might be a starting point for someone who knows python's inside well enough. > > There are problems with the embedded Python: > > 1. Very few people use it. Possible. I wouldn't claim to know this, though :-) I suppose there are more users of it than we see here. > 2. I think most people would prefer Perl Actually, I start to prefer python - much more readable after a while, for part-time programmers like I am one. > 3. It doesn't function perfectly since it is impossible to call certain > functions. I forgot the details but it is pretty annoying. Yes, that's something I and others noticed. In fact, this would need to be fixed - by someone who knows how. > 4. The links always print warning messages because they continue for > something > like 4 versions now to use deprecated code for temp files that has security > problems. Yes, I even reported this to you once :-) > 5. The linking code is really quite complicated. Hmm. I've been playing with embedding python into a C program, and found it reasonably straightforward. And that's from someone who ususally only uses ./configure && make && make install :-) > 6. Python is single threaded, which means that if multiple Bacula threads try > to use Python at the same time, I have to block them allowing only one to run > at a time. That's a serious problem, I think. > 7. Given the above I would rather not support it -- and no one else is likely > to come forward and do so. The support issue is probably the thing with the most weight here. But you wrote you "would rather not", so I assume if someone is found who will help you with it, your decision might change? ... > > Both Python and variables for LabelFormat are likely to remain in in the > initial 3.0 release. Unless I have a Python replacement, which is unlikely. So we can plan for about one year now. Good enough for me. Arno > Regards, > > Kern > -- Arno Lehmann IT-Service Lehmann www.its-lehmann.de - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] python support removal
On Monday 05 November 2007 13:12, Arno Lehmann wrote: > Hi, > > I'm sending this to the list - I suppose you wanted it to go there, too. > > 05.11.2007 10:58,, Rich wrote:: > > On 2007.11.04. 23:02, Arno Lehmann wrote: > > ... > > > >> True. But chances might be better to find such a person if python was > >> left in... if we had it in Bacula (as long as possible - Bacula core > >> development might some day get incompatible with how python is > >> embedded today - ) that might be a starting point for someone who > >> knows python's inside well enough. There are problems with the embedded Python: 1. Very few people use it. 2. I think most people would prefer Perl 3. It doesn't function perfectly since it is impossible to call certain functions. I forgot the details but it is pretty annoying. 4. The links always print warning messages because they continue for something like 4 versions now to use deprecated code for temp files that has security problems. 5. The linking code is really quite complicated. 6. Python is single threaded, which means that if multiple Bacula threads try to use Python at the same time, I have to block them allowing only one to run at a time. 7. Given the above I would rather not support it -- and no one else is likely to come forward and do so. > >> > >> Anyone of you active on the python developers mailing list? There > >> might be someone around who would support pythons embedding in other > >> hardware looking for a nice project (with not too many support issues > >> currently...) > > > > so i'm a bit puzzled here now. > > python vs labelformat - which will get booted ? :) I don't have any intention of doing away with the basic labelformat. However the vars code will eventually go, because it is mind bogglingly complicated and doesn't really have all the functionality that the user wants. I was hoping to replace it with the Python code, but Python just didn't work out. > > I don't know... there seem to be problems with either of those. > > LabelFormat is hard to understand and inflexible (in comparison with a > python script). Yes, so use Python for the moment. At some point you may have to change, though I hope to provide you a way to get to Python without having it linked in -- since I don't yet have it running, I cannot say what changes it may need to the scripts. > > Python requires more maintenance. > > What we'll end up with I have no idea. Kern knows, perhaps, so I cc'ed > him. Yes, I have a good idea, am working on it, but aside from a dummy little demo (1/20 th of what I need), it is vaporware. > > > i'd really like to get this working on the test system, where i can > > freely debug python, if needed. > > > > i could roll it out with labelformat, but if that breaks in a year (and > > python is kept), i'll have a bigger problem. > > I guess that a final decision will not be made before version 3 is in > the pipeline. Version 3.0, probably won't be out until June of 2008 at the best. I hope it will have a better alternative. Once I am sure I have a better solution, all the old stuff will be removed in the following version -- after announcing it. > > As far as I know, Kern is currently fixing things in the 2.2 versions, > and thinking about major projects to put into version 3. Yes, 2.2.6 is due out in a week or so, and is a pure bug fix. The current 2.2.5 is looking really stable, and most of the bugs I have been fixing for the last few months are long standing one ... > > If, during the initial coding of version 3, problems with LabelFormat > or python develop, a decision will be made. I'm not in a position to > foresee what will happen, or even which option - LabelFormat or python > - is more likely to be dropped, though. Both Python and variables for LabelFormat are likely to remain in in the initial 3.0 release. Unless I have a Python replacement, which is unlikely. Regards, Kern - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] python support removal
Hi, I'm sending this to the list - I suppose you wanted it to go there, too. 05.11.2007 10:58,, Rich wrote:: > On 2007.11.04. 23:02, Arno Lehmann wrote: > ... >> True. But chances might be better to find such a person if python was >> left in... if we had it in Bacula (as long as possible - Bacula core >> development might some day get incompatible with how python is >> embedded today - ) that might be a starting point for someone who >> knows python's inside well enough. >> >> Anyone of you active on the python developers mailing list? There >> might be someone around who would support pythons embedding in other >> hardware looking for a nice project (with not too many support issues >> currently...) > > so i'm a bit puzzled here now. > python vs labelformat - which will get booted ? :) I don't know... there seem to be problems with either of those. LabelFormat is hard to understand and inflexible (in comparison with a python script). Python requires more maintenance. What we'll end up with I have no idea. Kern knows, perhaps, so I cc'ed him. > i'd really like to get this working on the test system, where i can > freely debug python, if needed. > > i could roll it out with labelformat, but if that breaks in a year (and > python is kept), i'll have a bigger problem. I guess that a final decision will not be made before version 3 is in the pipeline. As far as I know, Kern is currently fixing things in the 2.2 versions, and thinking about major projects to put into version 3. If, during the initial coding of version 3, problems with LabelFormat or python develop, a decision will be made. I'm not in a position to foresee what will happen, or even which option - LabelFormat or python - is more likely to be dropped, though. Arno -- Arno Lehmann IT-Service Lehmann www.its-lehmann.de - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] python support removal
you probably wanted to send this to list ;) On 2007.11.05. 13:01, Marek Simon wrote: > I think some scripting support is good for various hacking and unusual > solutions, but I think python is kind of "exotical" language. Very few > users know it, very few projects is written in it and on universities > it's tought very rarely. May be some other language would be appriciate. it's not that exotic, actually. you can even write openoffice.org macros in it :) as for the language itself, i can't comment. i don't code, and if i can configure it for my liking once, that's all i want. oh, and i also want it not to break on upgrades =) > MArek ... -- Rich - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] python support removal
Hi, 03.11.2007 20:32,, Dan Langille wrote:: > On 3 Nov 2007 at 19:58, [EMAIL PROTECTED] wrote: > >> El jue, 01-11-2007 a las 10:12 +0100, Arno Lehmann escribió: >> >>> Hi, >>> >>> 31.10.2007 18:28,, Rich wrote:: see http://bugs.bacula.org/view.php?id=998 "After version 2.2.x Python will no longer be support -- there are an insufficient number of users." >>> Oops... I missed that. Thanks for bringing it to my attention! >>> which kinda worries me a bit. what about "Label Format" directive ? if python was supposed to replace it, but is being removed itself... will this directive stay supported ? arno, i guess you will not have to devote time for python scripts anymore ;) >>> I'd rather try to nag Kern to keep python in there. Once I get around >>> to setting up a new backup server here in the office, I do have some >>> plans with python :-) ... > The issue is one of support. When a bug arises, someone has to fix > it. At present, that someone is Kern. Bacula needs more people that > can fix those bugs. True. But chances might be better to find such a person if python was left in... if we had it in Bacula (as long as possible - Bacula core development might some day get incompatible with how python is embedded today - ) that might be a starting point for someone who knows python's inside well enough. Anyone of you active on the python developers mailing list? There might be someone around who would support pythons embedding in other hardware looking for a nice project (with not too many support issues currently...) Arno -- Arno Lehmann IT-Service Lehmann www.its-lehmann.de - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] python support removal
On 3 Nov 2007 at 19:58, [EMAIL PROTECTED] wrote: > El jue, 01-11-2007 a las 10:12 +0100, Arno Lehmann escribió: > > > Hi, > > > > 31.10.2007 18:28,, Rich wrote:: > > > see > > > http://bugs.bacula.org/view.php?id=998 > > > > > > "After version 2.2.x Python will no longer be support -- there are an > > > insufficient number of users." > > > > Oops... I missed that. Thanks for bringing it to my attention! > > > > > which kinda worries me a bit. > > > what about "Label Format" directive ? if python was supposed to replace > > > it, but is being removed itself... will this directive stay supported ? > > > > > > arno, i guess you will not have to devote time for python scripts anymore > > > ;) > > > > I'd rather try to nag Kern to keep python in there. Once I get around > > to setting up a new backup server here in the office, I do have some > > plans with python :-) > > > > Arno > > > > > +1 ! > > By now my first approach on Oracle RMAN + Bacula will be running > predefined shell script + rman scripts launched > from bacula but the next step ( once we have all scripts stable ) is to > create some tables in bacula catalog where will be stored > data from each oracle database/instance and create a set of menu options > ( a dream: Bacula rman plugin ) and directly perform > database backup/restore from bacula ( instruct bacula to restore and > recover datafile test.dbf on database orcl, for example ) and > afaik phyton is the way to go if I don't wanna load Kern with more work > to do. The issue is one of support. When a bug arises, someone has to fix it. At present, that someone is Kern. Bacula needs more people that can fix those bugs. -- Dan Langille - http://www.langille.org/ Available for hire: http://www.freebsddiary.org/dan_langille.php - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] python support removal
El jue, 01-11-2007 a las 10:12 +0100, Arno Lehmann escribió: > Hi, > > 31.10.2007 18:28,, Rich wrote:: > > see > > http://bugs.bacula.org/view.php?id=998 > > > > "After version 2.2.x Python will no longer be support -- there are an > > insufficient number of users." > > Oops... I missed that. Thanks for bringing it to my attention! > > > which kinda worries me a bit. > > what about "Label Format" directive ? if python was supposed to replace > > it, but is being removed itself... will this directive stay supported ? > > > > arno, i guess you will not have to devote time for python scripts anymore ;) > > I'd rather try to nag Kern to keep python in there. Once I get around > to setting up a new backup server here in the office, I do have some > plans with python :-) > > Arno > +1 ! By now my first approach on Oracle RMAN + Bacula will be running predefined shell script + rman scripts launched from bacula but the next step ( once we have all scripts stable ) is to create some tables in bacula catalog where will be stored data from each oracle database/instance and create a set of menu options ( a dream: Bacula rman plugin ) and directly perform database backup/restore from bacula ( instruct bacula to restore and recover datafile test.dbf on database orcl, for example ) and afaik phyton is the way to go if I don't wanna load Kern with more work to do. D. - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] python support removal
Or perhaps if there are any coders on this list who would band together to keep this part alive and perhaps take the ownership for this piece of the puzzle off Kern's hands? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steen Sent: 01 November 2007 01:01 To: bacula-users@lists.sourceforge.net Subject: Re: [Bacula-users] python support removal On Wednesday 31 October 2007 20:49:30 Michael Short wrote: > I plan to make use of this feature within the next few months... > > This is really disturbing news. > > -Michael > > On Oct 31, 2007 12:28 PM, Rich <[EMAIL PROTECTED]> wrote: > > see > > http://bugs.bacula.org/view.php?id=998 > > > > "After version 2.2.x Python will no longer be support -- there are > > an insufficient number of users." I was thinking of this as a kind of guarantee that you could always use this to get what you wanted if by no other way. Maybe it was too early to call it off - if the users show up maybe there is still hope. -- Regards Steen - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] python support removal
Hi, 31.10.2007 18:28,, Rich wrote:: > see > http://bugs.bacula.org/view.php?id=998 > > "After version 2.2.x Python will no longer be support -- there are an > insufficient number of users." Oops... I missed that. Thanks for bringing it to my attention! > which kinda worries me a bit. > what about "Label Format" directive ? if python was supposed to replace > it, but is being removed itself... will this directive stay supported ? > > arno, i guess you will not have to devote time for python scripts anymore ;) I'd rather try to nag Kern to keep python in there. Once I get around to setting up a new backup server here in the office, I do have some plans with python :-) Arno -- Arno Lehmann IT-Service Lehmann www.its-lehmann.de - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] python support removal
On Wednesday 31 October 2007 20:49:30 Michael Short wrote: > I plan to make use of this feature within the next few months... > > This is really disturbing news. > > -Michael > > On Oct 31, 2007 12:28 PM, Rich <[EMAIL PROTECTED]> wrote: > > see > > http://bugs.bacula.org/view.php?id=998 > > > > "After version 2.2.x Python will no longer be support -- there are an > > insufficient number of users." I was thinking of this as a kind of guarantee that you could always use this to get what you wanted if by no other way. Maybe it was too early to call it off - if the users show up maybe there is still hope. -- Regards Steen - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] python support removal
I plan to make use of this feature within the next few months... This is really disturbing news. -Michael On Oct 31, 2007 12:28 PM, Rich <[EMAIL PROTECTED]> wrote: > see > http://bugs.bacula.org/view.php?id=998 > > "After version 2.2.x Python will no longer be support -- there are an > insufficient number of users." > > which kinda worries me a bit. > what about "Label Format" directive ? if python was supposed to replace > it, but is being removed itself... will this directive stay supported ? > > arno, i guess you will not have to devote time for python scripts anymore ;) > -- > Rich > > - > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > ___ > Bacula-users mailing list > Bacula-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bacula-users > - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] python support
On 2007.10.29. 23:38, Arno Lehmann wrote: ... >>> import datetime >> and this is where it breaks. >> just adding that line to the script prevents director from starting at all : >> >> Fatal Python error: Interpreter not initialized (version mismatch?) > > That looks like a python problem... or something related to the way > python is embedded into Bacula. You should consider a bug report at > bugs.bacula.org, and point out that this might be a configure or > linking problem, or even one of finding the right python module path. done as http://bugs.bacula.org/view.php?id=998 ... >> actually, i would prefer to error out in such a case - if volume exists, >> something's broken. > > Well, relying onto the number of volumes in a pool is not safe, for > example. Imagine you have volumes V1, V2, V4 in a pool and label with > 'V'+number. The next volume will be the fourth one, so you'd end up > with V4 a second time. oh, no, i am using single volume (file) per job, and each is named with date-hour-minute. if the same job is executed twice in a single minite (especially as i have only one concurrent job configured), something's not right :) > As this can happen easily when you delete volumes, precautions are > important. > >> looking over the example, i could not find a way to cancel the job - how >> would i do that ? > > I don't know - perhaps return the null value from the method. You'll > have to try :-) nope, returning 0 still allows to proceed :) ... > Arno -- Rich - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] python support
Hi, 29.10.2007 18:09,, Rich wrote:: > On 2007.10.27. 17:27, Arno Lehmann wrote: > ... >>> 2. if "Scripts Directory" is specified in director configuration file, >>> director can't be stopped with ctrl+c, when run in foreground; >> I don't know if this qualifies as a bug - because, in normal >> circumstances, you should only run the DIR in foreground under the >> debugger (Kern says ;-) - but I don't think this is serious. > > yeah, but consistency and obeying ctrl+c in foreground are good ;) True, but given the relatively low impact of this you'll have to be good at nagging Kern into fixing it - or do it yourself :-) > ... >>> 1. the example is using both lines with spacing and without spacing >>> around equal sign (a=b and a = b). which would be a better style choice ? >> I prefer the spaces around operators because it creates much better >> readability. Others disagree. > > actually, i don't care that much about the method used as for it being > consistent in the example script :) Good point. But then, especially given this discussion, I get the impression the python scripting chapter needs a major rework anyway... > ... >>> 4. does somebody have example on writing out datetime string that would >>> reproduce behaviour that label format currently produces for >>> "${Year}.${Month:p/2/0/r}.${Day:p/2/0/r}-${Hour:p/2/0/r}.${Minute:p/2/0/r}" >>> ? >> Again, no examples, manuals, or even working code, but something like >> >> import datetime > > and this is where it breaks. > just adding that line to the script prevents director from starting at all : > > Fatal Python error: Interpreter not initialized (version mismatch?) That looks like a python problem... or something related to the way python is embedded into Bacula. You should consider a bug report at bugs.bacula.org, and point out that this might be a configure or linking problem, or even one of finding the right python module path. Currently, I have no idea how to fix or further diagnose this. > Kaboom! bacula-dir, backup_1-dir got signal 6 - IOT trap. Attempting > traceback. > Kaboom! exepath=/sbin/ > Calling: /sbin/btraceback /sbin/bacula-dir 32340 > execv: /sbin/btraceback failed: ERR=No such file or directory > Traceback complete, attempting cleanup ... > Orphaned buffer: backup_1-dir 16 bytes buf=820b150 allocated at > watchdog.c:86 > Orphaned buffer: backup_1-dir 16 bytes buf=82330a8 allocated at > watchdog.c:87 > > > on #python, it was suggested that : > "that error is caused by importing a module compiled for a different > version of Python, on Windows." > > but i don't understand how could that be possible > > where could the problem be ? configure, linking, module path - I suppose you need to be good with software building and gdb to find a solution here. > ... >>> 5. a (slightly modified) line reads : >>> job.JobReport = "Exists=%d %s" % (job.DoesVolumeExist(Vol), Vol) >>> >>> if i understand correctly, it would only add a line to the report and >>> proceed, right ? >> Yup. >> >>> it seems that in such a case job simply stucks, waiting for a manual >>> volume specification. >>> can i make a check that would error out if such a volume already exists ? >> Sure. Check the volume name you just created using DoesVolumeExist, >> and if it already exists, append or modify a suffix and loop. >> Otherwise, continue. > > actually, i would prefer to error out in such a case - if volume exists, > something's broken. Well, relying onto the number of volumes in a pool is not safe, for example. Imagine you have volumes V1, V2, V4 in a pool and label with 'V'+number. The next volume will be the fourth one, so you'd end up with V4 a second time. As this can happen easily when you delete volumes, precautions are important. > looking over the example, i could not find a way to cancel the job - how > would i do that ? I don't know - perhaps return the null value from the method. You'll have to try :-) >> Hope this helps, > > it did a lot, huge thanks. > i hope that the result of my pain will help somebody else :) Definitely... at least me. If I find the time, I'll play with python scripting. Perhaps even this year or 2008 ;-) Arno >> Arno -- Arno Lehmann IT-Service Lehmann www.its-lehmann.de - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] python support
On 2007.10.29. 19:09, Rich wrote: ... >> import datetime > > and this is where it breaks. > just adding that line to the script prevents director from starting at all : > > Fatal Python error: Interpreter not initialized (version mismatch?) > Kaboom! bacula-dir, backup_1-dir got signal 6 - IOT trap. Attempting > traceback. > Kaboom! exepath=/sbin/ > Calling: /sbin/btraceback /sbin/bacula-dir 32340 > execv: /sbin/btraceback failed: ERR=No such file or directory > Traceback complete, attempting cleanup ... > Orphaned buffer: backup_1-dir 16 bytes buf=820b150 allocated at > watchdog.c:86 > Orphaned buffer: backup_1-dir 16 bytes buf=82330a8 allocated at > watchdog.c:87 > > > on #python, it was suggested that : > "that error is caused by importing a module compiled for a different > version of Python, on Windows." a bit more on this :) "You have to make aboslutely sure that what Bacula links against, at runtime, is the right version. You also have to make sure that the modules you end up importing at runtime are for the same Python version, and also that this Bacula program properly initializes the Python it embeds." as i have no idea how to proceed, i would appreciate any help in debugging and resolving python scripting in bacula. ... -- Rich - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] python support
On 2007.10.27. 17:27, Arno Lehmann wrote: ... >> 2. if "Scripts Directory" is specified in director configuration file, >> director can't be stopped with ctrl+c, when run in foreground; > > I don't know if this qualifies as a bug - because, in normal > circumstances, you should only run the DIR in foreground under the > debugger (Kern says ;-) - but I don't think this is serious. yeah, but consistency and obeying ctrl+c in foreground are good ;) ... >> 1. the example is using both lines with spacing and without spacing >> around equal sign (a=b and a = b). which would be a better style choice ? > > I prefer the spaces around operators because it creates much better > readability. Others disagree. actually, i don't care that much about the method used as for it being consistent in the example script :) ... >> 4. does somebody have example on writing out datetime string that would >> reproduce behaviour that label format currently produces for >> "${Year}.${Month:p/2/0/r}.${Day:p/2/0/r}-${Hour:p/2/0/r}.${Minute:p/2/0/r}" >> ? > > Again, no examples, manuals, or even working code, but something like > > import datetime and this is where it breaks. just adding that line to the script prevents director from starting at all : Fatal Python error: Interpreter not initialized (version mismatch?) Kaboom! bacula-dir, backup_1-dir got signal 6 - IOT trap. Attempting traceback. Kaboom! exepath=/sbin/ Calling: /sbin/btraceback /sbin/bacula-dir 32340 execv: /sbin/btraceback failed: ERR=No such file or directory Traceback complete, attempting cleanup ... Orphaned buffer: backup_1-dir 16 bytes buf=820b150 allocated at watchdog.c:86 Orphaned buffer: backup_1-dir 16 bytes buf=82330a8 allocated at watchdog.c:87 on #python, it was suggested that : "that error is caused by importing a module compiled for a different version of Python, on Windows." but i don't understand how could that be possible where could the problem be ? ... >> 5. a (slightly modified) line reads : >> job.JobReport = "Exists=%d %s" % (job.DoesVolumeExist(Vol), Vol) >> >> if i understand correctly, it would only add a line to the report and >> proceed, right ? > > Yup. > >> it seems that in such a case job simply stucks, waiting for a manual >> volume specification. >> can i make a check that would error out if such a volume already exists ? > > Sure. Check the volume name you just created using DoesVolumeExist, > and if it already exists, append or modify a suffix and loop. > Otherwise, continue. actually, i would prefer to error out in such a case - if volume exists, something's broken. looking over the example, i could not find a way to cancel the job - how would i do that ? > Hope this helps, it did a lot, huge thanks. i hope that the result of my pain will help somebody else :) > Arno -- Rich - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] python support
Hi, 26.10.2007 16:56,, Rich wrote:: > On 2007.10.26. 14:04, Rich wrote: >> i've recompiled bacula 2.2.5 with python. configure output claims it is >> enabled : >> Python support: yes >> >> but even starting director with -f -d90 doesn't produce any messages - >> manual claims that a message should be printed : >> >> 09-Jun 15:14 bacula-dir: ERROR in pythonlib.c:131 Could not import >> Python script /etc/bacula/scripts/DirStartUp. Python disabled. >> >> i did not do 'make clean' after enabling python - was that required ? > > ok, this didn't help. even after a clean compile bacula dos not attempt > to use scripts. > i even tried with strace -e file, not even a single attempt to load any > python script. > > turns out, i must explicitly add "Scripts Directory" parameter... from > manual, i understood that bacula would be looking in /etc/bacula/scripts > by default - it says "normal default /etc/bacula/scripts". > > so, some suggestions/problems i noticed :) > > 1. "(normal default /etc/bacula/scripts," - unclosed parenthesis in the > manual. > also, this paragraph probably should note that the directive has to be > added and no actual default is enabled. That should be added to the manual... > 2. if "Scripts Directory" is specified in director configuration file, > director can't be stopped with ctrl+c, when run in foreground; I don't know if this qualifies as a bug - because, in normal circumstances, you should only run the DIR in foreground under the debugger (Kern says ;-) - but I don't think this is serious. > 3. if bacula is compiled with python support, maybe it is worth adding > this parameter to the default director configuration file ? > -- Probably. The packagers should take care of this, too. > now, for the actual scripts... > > 1. the example is using both lines with spacing and without spacing > around equal sign (a=b and a = b). which would be a better style choice ? I prefer the spaces around operators because it creates much better readability. Others disagree. > 2. it seems that i got it partially working by using the following lines : > Vol = "%s_%s-%s-%d" % (job.Pool, job.Job, job.Level, numvol) > job.JobReport = "Exists=%d %s" % (job.DoesVolumeExist(Vol), Vol) > job.VolumeName=Vol > > are there any huge mistakes ? No, this looks about correct. > 3. can i somehow avoid this %d, %s thing and specifying variables after > that ? like, writing someting like {job.Pool)_{job.Job}-{job.Level} etc. You could concatenate the job attributes and the extra characters like "str(job.Pool) + '_' + str(job.Job) + ... (or something similar - I don't have access to any python documentation and examples currently) but the original syntax is moch more easy to read IMO. > 4. does somebody have example on writing out datetime string that would > reproduce behaviour that label format currently produces for > "${Year}.${Month:p/2/0/r}.${Day:p/2/0/r}-${Hour:p/2/0/r}.${Minute:p/2/0/r}" > ? Again, no examples, manuals, or even working code, but something like import datetime now = datetime.datetime.now() Vol = "%4d.%2d.%2d-%2d.%2d" % (now.year, now.month, now.day, now.hour, now.minute) should work. > 5. a (slightly modified) line reads : > job.JobReport = "Exists=%d %s" % (job.DoesVolumeExist(Vol), Vol) > > if i understand correctly, it would only add a line to the report and > proceed, right ? Yup. > it seems that in such a case job simply stucks, waiting for a manual > volume specification. > can i make a check that would error out if such a volume already exists ? Sure. Check the volume name you just created using DoesVolumeExist, and if it already exists, append or modify a suffix and loop. Otherwise, continue. Hope this helps, Arno -- Arno Lehmann IT-Service Lehmann www.its-lehmann.de - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users
Re: [Bacula-users] python support
On 2007.10.26. 14:04, Rich wrote: > i've recompiled bacula 2.2.5 with python. configure output claims it is > enabled : > Python support: yes > > but even starting director with -f -d90 doesn't produce any messages - > manual claims that a message should be printed : > > 09-Jun 15:14 bacula-dir: ERROR in pythonlib.c:131 Could not import > Python script /etc/bacula/scripts/DirStartUp. Python disabled. > > i did not do 'make clean' after enabling python - was that required ? ok, this didn't help. even after a clean compile bacula dos not attempt to use scripts. i even tried with strace -e file, not even a single attempt to load any python script. turns out, i must explicitly add "Scripts Directory" parameter... from manual, i understood that bacula would be looking in /etc/bacula/scripts by default - it says "normal default /etc/bacula/scripts". so, some suggestions/problems i noticed :) 1. "(normal default /etc/bacula/scripts," - unclosed parenthesis in the manual. also, this paragraph probably should note that the directive has to be added and no actual default is enabled. 2. if "Scripts Directory" is specified in director configuration file, director can't be stopped with ctrl+c, when run in foreground; 3. if bacula is compiled with python support, maybe it is worth adding this parameter to the default director configuration file ? -- now, for the actual scripts... 1. the example is using both lines with spacing and without spacing around equal sign (a=b and a = b). which would be a better style choice ? 2. it seems that i got it partially working by using the following lines : Vol = "%s_%s-%s-%d" % (job.Pool, job.Job, job.Level, numvol) job.JobReport = "Exists=%d %s" % (job.DoesVolumeExist(Vol), Vol) job.VolumeName=Vol are there any huge mistakes ? 3. can i somehow avoid this %d, %s thing and specifying variables after that ? like, writing someting like {job.Pool)_{job.Job}-{job.Level} etc. 4. does somebody have example on writing out datetime string that would reproduce behaviour that label format currently produces for "${Year}.${Month:p/2/0/r}.${Day:p/2/0/r}-${Hour:p/2/0/r}.${Minute:p/2/0/r}" ? 5. a (slightly modified) line reads : job.JobReport = "Exists=%d %s" % (job.DoesVolumeExist(Vol), Vol) if i understand correctly, it would only add a line to the report and proceed, right ? it seems that in such a case job simply stucks, waiting for a manual volume specification. can i make a check that would error out if such a volume already exists ? -- Rich - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ___ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users