# This is the list of Bacula daemon events that you
# can receive.
-class BaculaEvents:
+class BaculaEvents(object):
def __init__(self):
# Called here when a new Bacula Events class is
# is created. Normally not used
"""
These are the Job events that you can receive.
"""
-class JobEvents:
+class JobEvents(object):
def __init__(self):
# Called here when you instantiate the Job. Not
# normally used
noop = 1
- def JobInit:
+ def JobInit(self, job):
# Called when the job is first scheduled
noop = 1
- def JobRun:
+ def JobRun(self, job):
# Called just before running the job after initializing
# This is the point to change most Job parameters.
# It is equivalent to the JobRunBefore point.
# Called when Bacula wants a new Volume name. The Volume
# name returned, if any, must be stored in job.VolumeName
jobid = job.JobId
- client = job.Client
- numvol = job.NumVols
- volname = "TestA-001"
- job.JobReport = "JobId=%d Client=%s NumVols=%d VolumeName=%s" % (jobid, client, numvol,volname)
+ client = job.Client
+ numvol = job.NumVols;
+ print job.CatalogRes
+ job.JobReport = "JobId=%d Client=%s NumVols=%d" % (jobid, client, numvol)
job.JobReport="Python before New Volume set for Job.\n"
- job.VolumeName=volname
+ Vol = "TestA-%d" % numvol
+ job.JobReport = "Exists=%d TestA-%d" % (job.DoesVolumeExist(Vol), numvol)
+ job.VolumeName="TestA-%d" % numvol
+ job.JobReport="Python after New Volume set for Job.\n"
+ return 1
def VolumePurged(self, job):
# Called when a Volume is purged. The Volume name can be referenced