I'm using Bacula 2.2.5 and have tried auto labeling with 
LabelFormat but haven't had much luck.  I don't know python but since 
LabelFormat is deprecated I thought I'd go ahead and give it a try.  My 
goal is to get volume names ( and the corresponding file name on disk, 
I'm backing up to disk ) to be formatted like jobname-date-"two digit 
number of volumes for this job".  I've also set the max volume size to 5 
GB.  So if I had a job named sivadaily run at 0300 and backup 9 GB I 
would like the resulting two volumes to be sivadaily-20071130fr0300-01 
and sivadaily-20071130fr0300-02.

     I started with the sample director startup script and the 
documentation at 
http://www.bacula.org/dev-manual/Python_Scripting.html#SECTION003560000000000000000.
 
    I defined "jobname = job.JobName" and modified job.VolumeName in 
NewVolume() to be 'job.VolumeName="%s-%d" % (jobname, numvol)'.  Then I 
ran a test job, cas-testdaily, and got volume autolabeled as 'Labeled 
new Volume "jobname-44"'.
     So I guess definition of jobname didn't work.  Also, I'm assuming 
the %s and %d are for string variable and integer variable although a 
bit of googling and python manual reading hasn't verified that.

     Any suggestions for how to accomplish what I'm after and 
recommendations for learning the python basics demonstrated in the 
sample script?


Jason Joines
=================================


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to