is there a way to get bacula to create file based volumes with timestamps in names and then instead of recycling them (as that would just use a volume with irrelevant timestamp on it) just dropping them and creating new one with actual timestamp?
Pool {
Name = "FullBackups"
Pool Type = Backup
Recycle = no
AutoPrune = yes
Action
On Purge = Truncate
Volume Retention = 3 months
Volume Use Duration = 1 month
Maximum Volume Bytes = 4700000000
}
Pool {
Name = "DiffBackups"
Pool Type = Backup
Recycle = no
AutoPrune = yes
Action On Purge = Truncate
Volume Retention = 1 month
Volume Use Duration = 1 week
Maximum Volume Bytes = 4700000000
}
Pool {
Name = "IncrBackups"
Pool Type = Backup
Recycle = no
AutoPrune = yes
Action On Purge = Truncate
Volume Retention = 1 week
Volume Use Duration = 1 day
Maximum Volume Bytes = 4700000000
}
and then using python hook to create the timestamp labels I like:
class JobEvents(object):
...
def NewVolume(self, job):
stamp = {
"FullBackups": "%s-full" % time.strftime("%y%m000"),
"DiffBackups": "%s-diff" %
time.strftime("%y%m%W0"),
"IncrBackups": "%s-incr" % time.strftime("%y%m%W%w")
}
label = None
volid = 0
while not label or job.DoesVolumeExist(label):
label = "%s-%s.vol%02d" % (job.Storage, stamp[job.Pool], volid)
volid += 1
job.VolumeName = label
return 1
so I am then getting labels like (the meaning of the timestamp is <year><month><weekofyear><dayofweek>):
Offsite-1301034-incr.vol07
Offsite-1301000-full.vol02
Offsite-1302060-diff.vol00
I have no luck getting rid of the old volumes. the "Action On Purge = Truncate" doesn't seem to have any effect. When I do "list volumes" I can see the old volumes have status "Purged" but the volume is not truncated. Also it still remains in the catalog so in that case the catalog would be full of purged volumes soon.
Does anyone has a solution for this usecase? I understand bacula
is primarily designed for tapes and in such case my approach of dropping instead of recycling is not realistic but for file based volumes this would be very convenient.
thanks for any ideas,
Antony.