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

Reply via email to