- Release Notes for Bacula 1.37.3
+ Release Notes for Bacula 1.37.12
- Bacula code: Total files = 411 Total lines = 122,189 (*.h *.c *.in)
+ Bacula code: Total files = 419 Total lines = 124,877 (*.h *.c *.in)
+Note! The DB has been upgraded from version 8 to 9 and requres
+a DB upgrade.
Major Changes:
+- The Python interface has been updated to be object oriented.
+- This version has a new DIR <--> SD protocol. Both must be
+ upgraded at the same time.
- This version has a new database format that is not compatible
with previous databases. The upgrade scripts should work, but
they are not yet tested.
and regexfile. See below for details.
New Directives:
+- New Run directive in Job resource of DIR. It permits
+ cloning of jobs. To clone a copy of the current job, use
+ Run = "job-name level=%l since=\"%s\""
+ Note, job-name is normally the same name as the job that
+ is running but there is no restriction on what you put. If you
+ want to start the job by hand and use job overrides such as
+ storage=xxx, realize that the job will be started with the
+ default storage values not the overrides. The level=%l guarantees
+ that the chosen level of the job is the same, and the since=...
+ ensures that the job uses *exactly* the same time/date for incremental
+ and differential jobs. The since=... is ignored when level=Full.
+ A cloned job will not start additional clones, so it is not possible
+ to recurse.
- New Options keywords in a FileSet directive:
- WildDir xxx
Will do a wild card match against directories (files will not
import bacula
- The script is called with one argument, typically called j. This
- argument *must* be passed unchanged to each bacula function. The
+ The script is called with one argument, typically called jcr. This
+ argument *must* be used to access each bacula function. The
format of the call is slightly different for reading Bacula
variable and for writing bacula variables. See below.
Bacula variables can be read with:
- bacula.get(j, "Variable-name")
+ jcr.get("Variable-name")
- where j is the argument passed to the function, and Variable-name
+ where jcr is the argument passed to the function, and Variable-name
is on of the following:
JobId, Client, Pool, Storage, Catalog, MediaType, NumVols, DirName,
Bacula varibles can be set using Python keyword arguments:
- bacula.set(jcr=j, VolumeName="xyz")
+ jcr.set(VolumeName="xyz")
The two currently implemented writable "variables" are:
It is possible to submit a Bacula run command with the following:
- bacula.run(j, "run kernsave client=Matou storage=File")
+ jcr.run("run kernsave client=Matou storage=File")
this function returns the JobId of the job that was started. If
there is an error, the return value is zero.
== File EndJob.py ===
import bacula
-def EndJob(j):
- jobid = bacula.get(j, "JobId")
- client = bacula.get(j, "Client")
- bacula.set(jcr=j, JobReport="EndJob output: JobId=%d Client=%s.\n" % (jobid, client))
+def EndJob(jcr):
+ jobid = jcr.get("JobId")
+ client = jcr.get("Client")
+ jcr.set(JobReport="EndJob output: JobId=%d Client=%s.\n" % (jobid, client))
if (jobid < 5) :
- startid = bacula.run(j, "run kernsave")
+ startid = jcr.run("run kernsave")
print "Python started jobid=", startid
return 1
== File NewVolume.py ===
import bacula
-def NewVolume(j):
- jobid = bacula.get(j, "JobId")
+def NewVolume(jcr):
+ jobid = jcr.get("JobId")
print "JobId=", jobid
- client = bacula.get(j, "Client")
+ client = jcr.get("Client")
print "Client=" + client
- numvol = bacula.get(j, "NumVols");
+ numvol = jcr.get("NumVols");
print "NumVols=", numvol
- bacula.set(jcr=j, JobReport="New Volume set for Job.\n")
- bacula.set(jcr=j, VolumeName="TestA-001")
+ jcr.set(JobReport="New Volume set for Job.\n")
+ jcr.set(VolumeName="TestA-001")
return 1
====
-
-