2 Release Notes for Bacula 1.37.1
4 Bacula code: Total files = 398 Total lines = 117,151 (*.h *.c *.in)
8 - Preliminary Python Event support has been added. See below for
10 A Python script will be called at particular points or conditions
11 in Bacula called Events. The currently defined Events are called:
13 StartJob, EndJob, NewVolume
15 Where StartJob is called before the RunBeforeJob, EndJob is called after
16 RunAfterJob, and NewVolume, is called before all other "methods" of
17 obtaining a new Volume name, when one is needed.
19 The Python script of the same name as the Event name (but with a .py)
20 is called from the Scripts Directory (a directive defined in the
21 Director resource). Note, both the Filename, and the name of
22 the function in the file must correspond to the Event name.
24 Once the Python script gets control, it can have access to Bacula
29 The script is called with one argument, typically called j. This
30 argument *must* be passed unchanged to each bacula function. The
31 format of the call is slightly different for reading Bacula
32 variable and for writing bacula variables. See below.
34 Bacula variables can be read with:
36 bacula.get(j, "Variable-name")
38 where j is the argument passed to the function, and Variable-name
39 is on of the following:
41 JoId, Client, Pool, Storage, Catalog, MediaType, NumVols, DirName,
42 Level, Type, Job, JobName, JobStatus
44 Bacula varibles can be set using Python keyword arguments:
46 bacula.set(jcr=j, VolumeName="xyz")
48 The two currently implemented writable "variables" are:
50 VolumeName and JobReport
58 jobid = bacula.get(j, "JobId")
59 client = bacula.get(j, "Client")
60 bacula.set(jcr=j, JobReport="EndJob output: JobId=%d Client=%s.\n" % (jobid, client))
64 == File NewVolume.py ===
68 jobid = bacula.get(j, "JobId")
70 client = bacula.get(j, "Client")
71 print "Client=" + client
72 numvol = bacula.get(j, "NumVols");
73 print "NumVols=", numvol
74 bacula.set(jcr=j, JobReport="New Volume set for Job.\n")
75 bacula.set(jcr=j, VolumeName="TestA-001")
81 - Scripts Directory = <directory> name. Defines the directory from
82 which Bacula scripts will be called for events. In fact, Bacula
83 appends this name to the standard Python list of search directories,
84 so the script could also be in any of the Python system directories.
85 - In FileSet, you can exclude backing up of hardlinks (if you have
86 a lot, it can be very expensive), by using:
88 in the Options section. Patch supplied by David R Bosso. Thanks.
91 - "python restart" restarts the Python interpreter. Rather brutal, make
92 sure no Python scripts are running. This permits you to change
93 a Python script and get Bacula to use the new script.
96 - You must add --with-python=[DIR] to the configure command line
97 if you want Python support. Python 2.2 and 2.3 should be automatically
98 detected if in the standard place.
99 - With Python 2.2 version, the link of the Director gets a few linker
100 warnings due to the fact that Python pulls in some old non-secure
102 - With Python 2.3, there are a few compiler warnings.