[BAREOS] Action On Purge = Truncate not working or PEBKAC ?

1,090 views
Skip to first unread message

Thomas Guthmann

unread,
Dec 19, 2013, 7:43:42 PM12/19/13
to bareos...@googlegroups.com
Hi,

We use bareos 13.2.1 and we only backup on disk. One volume per host per type.
Therefore once we pass the retention period we would like to truncate the volume
but so far nothing is truncated despite 'Action On Purge = Truncate' in our pools
definition.

My understanding is that it should empty the volume and therefore leave a 0 size file
which we would remove via an external script because Bareos does not interact with
files directly. Obviously we would also trigger a delete volumename= to clean up
the Catalog.

So my questions are :
1. When Action On Purge = Truncate is triggered ?
2. What is missing to make it work ?
3. Do I need to have RunScript [1] in all my jobs ?

I did try 'purge volume action storage=File pool=bareos:pool:default.incremental' but
it comes with a scary messages [2] and I wouldn't like to lose all my incrementals ;)
So if someone can explain the consequences and mechanism it would be much appreciated.

Pool {
Name = "bareos:pool:default.incremental"
Label Format = "${Job}.incr.${Year}${Month:p/2/0/r}${Day:p/2/0/r}.${Hour:p/2/0/r}${Minute:p/2/0/r}"
Pool Type = Backup
# Clean up any we don't need, and keep them for a maximum of 40 days
# Note the files for the old volumes will still remain on the disk but will
# be truncated to a zero size. <<<< Not true yet... :)
Recycle = No
Auto Prune = Yes
Action On Purge = Truncate
Volume Retention = 40 Days
# Don't allow re-use of volumes; one volume per job only
Maximum Volume Jobs = 1
}

Example of one of our Job definition. $FQDN represents a hostname.
We have a SD defined per $FQDN to allow concurrent backups.
Job {
Name = "$FQDN"
Client = "$FQDN"
Type = Backup
FileSet = "All"
Storage = "bareos:storage:$FQDN"
Schedule = "Weekly:onTuesday"
Pool = "bareos:pool:default"
Full Backup Pool = "bareos:pool:default.full"
Incremental Backup Pool = "bareos:pool:default.incremental"
Differential Backup Pool = "bareos:pool:default.differential"
Messages = "bareos:messages:standard"
Rerun Failed Levels = no
Reschedule On Error = yes
Reschedule Interval = 10 minutes
Reschedule Times = 1
Write Bootstrap = "/bareos/bootstraps/%c.bsr"
}

PS: One could not use the 'Action On Purge' and use a script that would query the DB
to find what to delete but we might as well try to use Bareos features to free space.
A script would be my plan B solution which would have the advantage to have all logic in
one spot.

Cheers,
Thomas

[1]: http://www.bacula.org/en/dev-manual/main/main/New_Features_in_5_2_x.html#SECTION00351000000000000000
[2]: Scary message...
*purge volume action pool=bareos:pool:default.incremental

This command can be DANGEROUS!!!

It purges (deletes) all Files from a Job,
JobId, Client or Volume; or it purges (deletes)
all Jobs from a Client or Volume without regard
to retention periods. Normally you should use the
PRUNE command, which respects retention periods.
Using Catalog "bareos:postgresql"
The defined Storage resources are:
1: bareos:storage:default
2: bareos:storage:BackupCatalog
3: bareos:storage:$FQDN1
4: bareos:storage:$FQDN2
[..]


Bruno Friedmann

unread,
Dec 20, 2013, 5:55:35 AM12/20/13
to bareos...@googlegroups.com
I would say purge != prune

Retention timeout = prune a volume.

Delete volume = purge => trigger truncate volume file.


But that's guessing, I've always kept a volume until its reused.


--

Bruno Friedmann
Ioda-Net Sàrl www.ioda-net.ch

openSUSE Member
GPG KEY : D5C9B751C4653227
irc: tigerfoot
Reply all
Reply to author
Forward
0 new messages