On 2007.10.23. 22:02, Arno Lehmann wrote:
...
> That requirement, by the way, is not very problematic. The sample 
> given in the manual should almost work out of the box, and python is 
> easier to learn than Baculas variable substitution language :-)

i do not agree with that ;)

>>> This is described in the manual, for example 
>>> http://www.bacula.org/dev-manual/Python_Scripting.html#SECTION003560000000000000000
>> ...

i'm now trying to understand at least something in all this...

1. the example has a section that is not simply stating noop, but is 
preceded by it :

   def JobInit(self, job):
      noop = 1
      if (job.JobId < 2):
         startid = job.run("run kernsave")
         job.JobReport = "Python started new Job: jobid=%d\n" % startid
      print "name=%s version=%s conf=%s working=%s" % (bacula.Name, 
bacula.Version, bacula.ConfigFile, bacula.WorkingDir)

manual says "If you do not want a particular event, simply replace the 
existing code with a noop = 1."

what does this section do then ? is preceding it with noop = 1 also 
disabling it ?

2. the volume label itself.
i guess i should leave at least parts of "def JobStart", right ?
it creates JobEvents class, which in turn includes what seems to be the 
correct section - "def NewVolume".

i suppose this line should be modified :
Vol = "TestA-%d" % numvol

later two other lines have same string :

job.JobReport = "Exists=%d TestA-%d" % (job.DoesVolumeExist(Vol), numvol)
job.VolumeName="TestA-%d" % numvol

must i replace all of these strings ? if yes, can't they just be 
referenced from the first string, "Vol" ?

now, as for constructing the volume labal string... it seems that most 
variables map to something "job." - like job.Pool, job.Job, job.Level etc.

how would i use these variables to define the label ?

i am trying to imitate a volume label like
"${Pool}_${Job}-${Level}-${Year}.${Month:p/2/0/r}.${Day:p/2/0/r}-${Hour:p/2/0/r}.${Minute:p/2/0/r}"

which would also require variables like year, month etc. how can i 
include those ?

i'm really lost with all this, but this probably is the best time to do 
this as i have set up a test system before attempting a large upgrade, 
so postponing the change can come back to me later...
...
> 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

Reply via email to