]> git.sur5r.net Git - bacula/bacula/blob - bacula/ReleaseNotes
f5c936249442fb5aaa62fb91c5dfff2e35d838f9
[bacula/bacula] / bacula / ReleaseNotes
1
2           Release Notes for Bacula 1.37.1
3
4   Bacula code: Total files = 398 Total lines = 117,151 (*.h *.c *.in)
5
6
7 Major Changes:
8 - Preliminary Python Event support has been added. See below for
9   configuration.
10   A Python script will be called at particular points or conditions
11   in Bacula called Events. The currently defined Events are called:
12
13   StartJob, EndJob, NewVolume
14
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.
18
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.
23
24   Once the Python script gets control, it can have access to Bacula
25   variables by doing:
26
27   import bacula
28
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.
33
34   Bacula variables can be read with:
35
36   bacula.get(j, "Variable-name")
37
38   where j is the argument passed to the function, and Variable-name
39   is on of the following:
40
41    JoId, Client, Pool, Storage, Catalog, MediaType, NumVols, DirName,
42      Level, Type, Job, JobName, JobStatus
43
44    Bacula varibles can be set using Python keyword arguments:
45
46    bacula.set(jcr=j, VolumeName="xyz")
47
48    The two currently implemented writable "variables" are:
49
50    VolumeName and JobReport
51
52    Example:
53
54 == File EndJob.py ===
55 import bacula
56
57 def EndJob(j):
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))
61     return 1
62 ====
63
64 == File NewVolume.py ===
65 import bacula
66
67 def NewVolume(j):
68     jobid = bacula.get(j, "JobId")
69     print "JobId=", 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")
76     return 1
77 ====
78
79
80 New Directives:
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:
87     HardLinks = no
88   in the Options section. Patch supplied by David R Bosso. Thanks.              
89
90 New Commands:
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.
94
95 Items to note!!!
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
101   libraries.
102 - With Python 2.3, there are a few compiler warnings.
103
104 Other Items: