On 2007.11.30. 18:10, Jason Joines wrote:
>      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 

well, bad news for you. python seems to be the one who will go away.
labelformat variable expansion also is supposed to disappear at some 
point, but in the end it was suggested to simply use labelformat for now 
and deal with any potential changes in future.

> 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.

currently i am using the following labelformat value :
Label Format = 
"${Pool}_${Job}-${Level}-${Year}.${Month:p/2/0/r}.${Day:p/2/0/r}-${Hour:p/2/0/r}.${Minute:p/2/0/r}"

it should be possible to get out of it and bacula manual the desired 
format for you.

>      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
> =================================
-- 
  Rich

-------------------------------------------------------------------------
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