AutoPrune and Job Retention deprecation

120 views
Skip to first unread message

Michał Giza

unread,
Sep 26, 2024, 8:12:58 AM9/26/24
to bareos-users
Hello,
Is there an alternative option for AutoPrune and JobRetention? Both are deprecated (https://docs.bareos.org/Configuration/Director.html#config-Dir_Client_AutoPrune):

Sep 26 12:54:04 bareos.local bareos-dir[91769]:  * using deprecated keyword JobRetention on line 9 of file /etc/bareos/bareos-dir.d/client/web01-fd.conf
Sep 26 12:54:04 bareos.local bareos-dir[91769]:  * using deprecated keyword AutoPrune on line 10 of file /etc/bareos/bareos-dir.d/client/web01-fd.conf


I use them in every client's configuration. Example:

Client {
(...)
  File Retention = 30 days
  Job Retention = 6 months
  AutoPrune = yes
}


File Retention works, meaning I cannot restore backups older than the value set in this option. However, it seems that the backups aren't being deleted from the disk, as the disk usage still increasing.

Philipp Storz

unread,
Sep 26, 2024, 9:28:29 AM9/26/24
to Michał Giza, bareos-users
Hello,

instead of using these two deprecated directives, you should use the autopuning in the pool
directive to recycle your volumes together with the Volume retention directives in the pool.

See:
https://docs.bareos.org/Configuration/Director.html#config-Dir_Pool_AutoPrune
and:
https://docs.bareos.org/Configuration/Director.html#config-Dir_Pool_VolumeRetention

Here you also have a description how it works.

This mechanism will clean up your database when a volume is recycled; all data that is recoverable
will still be in the database.

In case you need to change your pool's volume retention, do not forget to apply the pool settings to
all volumes in the pool via the command "update volumes"

Best regards,

Philipp




Am 26.09.24 um 14:12 schrieb 'Michał Giza' via bareos-users:
> Hello,
> Is there an alternative option for AutoPrune and JobRetention? Both are deprecated (https://
> docs.bareos.org/Configuration/Director.html#config-Dir_Client_AutoPrune <https://docs.bareos.org/
> Configuration/Director.html#config-Dir_Client_AutoPrune>):
>
> Sep 26 12:54:04 bareos.local bareos-dir[91769]:  * using deprecated keyword JobRetention on line 9
> of file /etc/bareos/bareos-dir.d/client/web01-fd.conf
> Sep 26 12:54:04 bareos.local bareos-dir[91769]:  * using deprecated keyword AutoPrune on line 10 of
> file /etc/bareos/bareos-dir.d/client/web01-fd.conf
>
> I use them in every client's configuration. Example:
>
> /Client {
> (...)
>   File Retention = 30 days
>   Job Retention = 6 months
>   AutoPrune = yes
> }/
> /
> /
> File Retention works, meaning I cannot restore backups older than the value set in this option.
> However, it seems that the backups aren't being deleted from the disk, as the disk usage still
> increasing./
> /
>
> --
> You received this message because you are subscribed to the Google Groups "bareos-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to bareos-
> users+un...@googlegroups.com <mailto:bareos-users...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/bareos-users/
> bfc77e47-474f-4e55-92ef-84d6c3005d41n%40googlegroups.com <https://groups.google.com/d/msgid/bareos-
> users/bfc77e47-474f-4e55-92ef-84d6c3005d41n%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
Mit freundlichen Grüßen

Philipp Storz philip...@bareos.com
Bareos GmbH & Co. KG Phone: +49 221 63 06 93-92
http://www.bareos.com

Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
Geschäftsführer: Stephan Dühr, Jörg Steffens, Philipp Storz

Die "dass IT GmbH" wurde mit der "Bareos GmbH & Co. KG" verschmolzen,
siehe https://www.bareos.com/de/dassit-verschmelzung/
Message has been deleted

Michał Giza

unread,
Sep 27, 2024, 1:39:48 AM9/27/24
to bareos-users
Thank you for your response. I understand that since the longest retention period for backups in my config is 30 days, I should set Volume Retention option to 30. Is this a correct assumption?

What if I wanted to set retention per client? Like 30 days for web servers, and 7 days for develop environment.

Philipp Storz

unread,
Sep 27, 2024, 10:33:08 AM9/27/24
to bareos...@googlegroups.com
Hello,

Am 26.09.24 um 19:05 schrieb 'Michał Giza' via bareos-users:
> Thank you for your response. I understand that since the longest retention period for backups in my
> config is 30 days, I should set Volume Retention option to 30. Is this a correct assumption?

The volume retention needs to be set to 30 days, 30 would be 30 seconds.

>
> What if I wanted to set retention per client? Like 30 days for web servers, and 7 days for develop
> environment.
>
You need to create a pool for data with similar retention periods, so a pool "webservers" with a
retention of 30 days and a pool "develop" with a retention of 7 days.

Then you need to make sure that the jobs doing the backups write into the correct pool.
If you are using disk volumes, you probably want to configure "volume use duration" to 23 hours so
that every day a new volume is created and after the volume retention has passed a full volume can
be recycled.



> czwartek, 26 września 2024 o 15:28:29 UTC+2 Philipp Storz napisał(a):
>
> Hello,
>
> instead of using these two deprecated directives, you should use the autopuning in the pool
> directive to recycle your volumes together with the Volume retention directives in the pool.
>
> See:
> https://docs.bareos.org/Configuration/Director.html#config-Dir_Pool_AutoPrune <https://
> docs.bareos.org/Configuration/Director.html#config-Dir_Pool_AutoPrune>
> and:
> https://docs.bareos.org/Configuration/Director.html#config-Dir_Pool_VolumeRetention <https://
> docs.bareos.org/Configuration/Director.html#config-Dir_Pool_VolumeRetention>
>
> Here you also have a description how it works.
>
> This mechanism will clean up your database when a volume is recycled; all data that is recoverable
> will still be in the database.
>
> In case you need to change your pool's volume retention, do not forget to apply the pool
> settings to
> all volumes in the pool via the command "update volumes"
>
> Best regards,
>
> Philipp
>
>
>
>
> Am 26.09.24 um 14:12 schrieb 'Michał Giza' via bareos-users:
> > Hello,
> > Is there an alternative option for AutoPrune and JobRetention? Both are deprecated (https://
> > docs.bareos.org/Configuration/Director.html#config-Dir_Client_AutoPrune <http://
> docs.bareos.org/Configuration/Director.html#config-Dir_Client_AutoPrune> <https://
> docs.bareos.org/ <https://docs.bareos.org/>
> <https://groups.google.com/d/msgid/bareos-users/>
> > bfc77e47-474f-4e55-92ef-84d6c3005d41n%40googlegroups.com <http://40googlegroups.com>
> <https://groups.google.com/d/msgid/bareos- <https://groups.google.com/d/msgid/bareos->
> > users/bfc77e47-474f-4e55-92ef-84d6c3005d41n%40googlegroups.com?
> utm_medium=email&utm_source=footer <http://40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
> --
> Mit freundlichen Grüßen
>
> Philipp Storz philip...@bareos.com
> Bareos GmbH & Co. KG Phone: +49 221 63 06 93-92 <tel:+49%20221%2063069392>
> http://www.bareos.com <http://www.bareos.com>
>
> Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
> Geschäftsführer: Stephan Dühr, Jörg Steffens, Philipp Storz
>
> Die "dass IT GmbH" wurde mit der "Bareos GmbH & Co. KG" verschmolzen,
> siehe https://www.bareos.com/de/dassit-verschmelzung/ <https://www.bareos.com/de/dassit-
> verschmelzung/>
>
> --
> You received this message because you are subscribed to the Google Groups "bareos-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to bareos-
> users+un...@googlegroups.com <mailto:bareos-users...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/bareos-users/33b0f366-
> a856-4965-a8e4-3201212100a9n%40googlegroups.com <https://groups.google.com/d/msgid/bareos-
> users/33b0f366-a856-4965-a8e4-3201212100a9n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Michał Giza

unread,
Oct 9, 2024, 2:26:20 AM10/9/24
to bareos-users
Thank you, it seems to be working.

However, one backup job failed yesterday (disk problems) with retention of 2 days. I see that there is backup from 6 October to recover. Does this mean that Bareos doesn't apply Auto Prune when backup from particular day is missing?

Philipp Storz

unread,
Oct 10, 2024, 9:55:38 AM10/10/24
to bareos...@googlegroups.com
Am 09.10.24 um 08:26 schrieb 'Michał Giza' via bareos-users:
> Thank you, it seems to be working.
>
> However, one backup job failed yesterday (disk problems) with retention of 2 days. I see that there
> is backup from 6 October to recover. Does this mean that Bareos doesn't apply Auto Prune when backup
> from particular day is missing?

The retention period is the minimum time that the volume is kept, not the exact time.
Bareos guarantees, that the data on the volume will not be overwritten before the retention has
passed. However, if there are enough volumes, data can stay recoverable for longer time.

The retention only looks at the age of the volume. When a volume is pruned, the job is also removed
from the catalog db. If the volume is not pruned yet, the job stays in the database as it is still
recoverable.
Reply all
Reply to author
Forward
0 new messages