Hi all -

I've having trouble with variable expansion. I can get it to do padding and I can get it to do autoincrement, but I can't figure out how to do both in the same operation.

Here's the scenario:

I've been using Bacula for a couple years, but up to now I've been labeling tapes manually. Now I'm trying to set up automatic tape labeling. My tape names look like TAPE01, TAPE02, etc. so I obviously want to continue labeling them with that format. Unfortunately, I can't use the built-in NumVols because some earlier tapes have been destroyed, so the number of volumes in the pool no longer coincides with the next tape number. I've got a database counter defined in bacula-dir.conf

Counter {
 Name = DefaultPoolCounter
 Minimum=1
 Catalog=MyCatalog
}

The padding seems to work OK:

# var TAPE${DefaultPoolCounter:p/2/0/r}
TAPE02

And the autoincrement seems to work OK

#var TAPE${DefaultPoolCounter+}
TAPE2

#var TAPE${DefaultPoolCounter+}
TAPE3

But when I try to do both in the same operation, the counter is incremented, but the padding specifier is not honored. It's printed literally:

#var ${DefaultPoolCounter+:p/2/0/r}
TAPE3p/2/0/r}

#var ${DefaultPoolCounter+:p/2/0/r}
TAPE4p/2/0/r}

I've tried the '+' sign in various places...

#var ${DefaultPoolCounter:p/2/0/r+}
#var ${DefaultPoolCounter:p/2/0/r}+
#var ${DefaultPoolCounter:+p/2/0/r}

all to no avail.

What am I doing wrong?
- Cedric



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to