Bacula

From Servfire
Jump to: navigation, search

Some various notes on Bacula

Automatic incrementally numbered file labeling on "File" type backups

Set up a counter for each drive in the backup set like:

Counter {
  Name = Drive1Counter
  Catalog = MyCatalog
}

And then on the pool for your drive, do:

Pool {
  Name = Drive1
  Storage = Drive1
  Label Format = "drive1-${Drive1Counter+:p/4/0/r}"
}

That variable substitution parses down as the counter name, the plus increments the counter, then pads out the counter number to 4 wide, filling the space with 0s, and right aligned.

Reset Counters

If you're using counters for, say, split file drive backups and you replace the drive due to failure, you delete all the volumes for that drive since they're no longer accessable and useless, replace the drive, set it up for Bacula, but you find all the volume names are getting labeled from wherever the counter left off. Easy fix, in console, run:

sqlquery
UPDATE Counters SET CurrentValue = 0 WHERE Counter = "Drive1Counter"

Restarting the Bacula services after doing this is probably a good idea (director, storage and file).