]> git.sur5r.net Git - bacula/bacula/blob - bacula/ReleaseNotes
Update the documentation and ReleaseNotes.
[bacula/bacula] / bacula / ReleaseNotes
1
2           Release Notes for Bacula 1.37.2
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 
16   after RunAfterJob, and NewVolume, is called before all other 
17   "methods" of 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      JobId, 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    It is possible to submit a Bacula run command with the following:
53
54      bacula.run(j, "run kernsave client=Matou storage=File")
55
56    this function returns the JobId of the job that was started. If
57    there is an error, the return value is zero.
58
59    Example:
60
61 == File EndJob.py ===
62 import bacula
63
64 def EndJob(j):
65     jobid = bacula.get(j, "JobId")
66     client = bacula.get(j, "Client") 
67     bacula.set(jcr=j, JobReport="EndJob output: JobId=%d Client=%s.\n" % (jobid, client))
68     if (jobid < 5) :
69        startid = bacula.run(j, "run kernsave")
70        print "Python started jobid=", startid
71
72     return 1
73 ====
74
75 == File NewVolume.py ===
76 import bacula
77
78 def NewVolume(j):
79     jobid = bacula.get(j, "JobId")
80     print "JobId=", jobid
81     client = bacula.get(j, "Client") 
82     print "Client=" + client
83     numvol = bacula.get(j, "NumVols");
84     print "NumVols=", numvol
85     bacula.set(jcr=j, JobReport="New Volume set for Job.\n") 
86     bacula.set(jcr=j, VolumeName="TestA-001")
87     return 1
88 ====
89 - Part files support: File volumes can now be splitted in multiple
90   files, called "parts".
91 - DVD writing support, using parts, and a lot of new directives in
92   the Device resource of the Storage configuration file.
93
94 New Directives:
95 - Scripts Directory = <directory> name.  Defines the directory from 
96   which Bacula scripts will be called for events. In fact, Bacula
97   appends this name to the standard Python list of search directories,
98   so the script could also be in any of the Python system directories.
99 - In FileSet, you can exclude backing up of hardlinks (if you have
100   a lot, it can be very expensive), by using:
101     HardLinks = no
102   in the Options section. Patch supplied by David R Bosso. Thanks.
103 - MaximumPartSize = bytes (SD, Device resource)
104   Defines the maximum part size.
105 - Requires Mount = Yes/No (SD, Device resource)
106   Defines if the device require to be mounted to be read, and if it
107   must be written in a special way. If it set, the following directives 
108   must be defined in the same Device resource:
109   + Mount Point = directory
110     Directory where the device must be mounted. 
111   + Mount Command = name-string
112     Command that must be executed to mount the device. Before the command
113     is executed, %a is replaced with the Archive Device, and %m with the 
114     Mount Point.
115   + Unmount Command = name-string
116     Command that must be executed to unmount the device. Before the 
117     command is executed, %a is replaced with the Archive Device, and 
118     %m with the Mount Point.
119   + Write Part Command = name-string
120     Command that must be executed to write a part to the device. Before
121     the command is executed, %a is replaced with the Archive Device, %m 
122     with the Mount Point, %n with the current part number (0-based), 
123     and %v with the current part filename.
124   + Free Space Command = name-string
125     Command that must be executed to check how much free space is left 
126     on the device. Before the command is executed, %a is replaced with 
127     the Archive Device, %m with the Mount Point, %n with the current part
128     number (0-based), and %v with the current part filename.
129 - Write Part After Job = Yes/No (DIR, Job Resource, and Schedule Resource)
130   If this directive is set to yes (default no), a new part file will be
131   created after the job is finished.
132
133 New Commands:
134 - "python restart" restarts the Python interpreter. Rather brutal, make
135    sure no Python scripts are running. This permits you to change
136    a Python script and get Bacula to use the new script.
137
138 Items to note!!!
139 - You must add --with-python=[DIR] to the configure command line
140   if you want Python support.  Python 2.2 and 2.3 should be automatically
141   detected if in the standard place.
142 - With Python 2.2 version, the link of the Director gets a few linker
143   warnings due to the fact that Python pulls in some old non-secure
144   libraries.
145 - With Python 2.3, there are a few compiler warnings.
146
147 Other Items:
148 - 2 new scripts, dvd-writepart and dvd-freespace, in the scripts directory,
149   which are designed to be used as parameters to Write Part Command and
150   Free Space Command. They need the dvd+rw-tools to be installed
151   (http://fy.chalmers.se/~appro/linux/DVD+RW/).