Bacula-users

[Bacula-users] file storage volume labelling with time stamps

2013-02-15 14:27:30
Subject: [Bacula-users] file storage volume labelling with time stamps
From: Antony Mayi <antonymayi AT yahoo DOT com>
To: "bacula-users AT lists.sourceforge DOT net" <bacula-users AT lists.sourceforge DOT net>
Date: Fri, 15 Feb 2013 19:24:37 +0000 (GMT)
Hi,

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?

I was trying following approach:

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.
------------------------------------------------------------------------------
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users
<Prev in Thread] Current Thread [Next in Thread>