2 years retention #362

Closed
opened 2020-10-27 15:47:04 +00:00 by NoxInmortus · 6 comments

Hello,

I have a need to keep a backup for 2 year. Is this actually possible to do that with borgmatic ?

thanks

Hello, I have a need to keep a backup for 2 year. Is this actually possible to do that with borgmatic ? thanks
Owner

Thanks for the question! The way to accomplish that is via the keep_within option inside the retention section. Here's an example:

retention:
    keep_within: 2y

More info in the Borg docs.

Please report back in a couple of years on whether that worked. ;)

Thanks for the question! The way to accomplish that is via the `keep_within` option inside the `retention` section. Here's an example: ```yaml retention: keep_within: 2y ``` More info in the [Borg docs](https://borgbackup.readthedocs.io/en/stable/usage/prune.html#description). Please report back in a couple of years on whether that worked. ;)
witten added the
question / support
label 2020-10-27 17:15:51 +00:00
Author

hello @witten, if I may ask again :

let's take this example :

keep_within: 2y
keep_daily: 6
keep_weekly: 4
keep_monthly: 1
keep_yearly: 1

this means that currently I will have the last 6 daily backups, 4 backups for the last month, one backup for every last months, one backup for the past year << and this last will be kept for two years ?

hello @witten, if I may ask again : let's take this example : keep_within: 2y keep_daily: 6 keep_weekly: 4 keep_monthly: 1 keep_yearly: 1 this means that currently I will have the last 6 daily backups, 4 backups for the last month, one backup for every last months, one backup for the past year << and this last will be kept for two years ?
Owner

I think that's correct except for the "and this last will be kept for two years" part. Here's the relevant part of the Borg docs:

The --keep-within option takes an argument of the form “”, where char is “H”, “d”, “w”, “m”, “y”. For example, --keep-within 2d means to keep all archives that were created within the past 48 hours. “1m” is taken to mean “31d”. The archives kept with this option do not count towards the totals specified by any other options.

That to me suggests that all archives within two years would be kept. Which sounds like perhaps not what you're looking for!

This might be a good candidate for a Borg feature request of some sort?

I think that's correct *except* for the "and this last will be kept for two years" part. Here's the relevant part of the Borg docs: > The --keep-within option takes an argument of the form “<int><char>”, where char is “H”, “d”, “w”, “m”, “y”. For example, --keep-within 2d means to keep all archives that were created within the past 48 hours. “1m” is taken to mean “31d”. The archives kept with this option do not count towards the totals specified by any other options. That to me suggests that *all* archives within two years would be kept. Which sounds like perhaps not what you're looking for! This might be a good candidate for a Borg feature request of some sort?
Owner

Your best bet, if you can space the storage space, may be just to do keep_yearly: 2. That would keep one archive that's two years old and one archive that's one year old.

Your best bet, if you can space the storage space, may be just to do `keep_yearly: 2`. That would keep one archive that's two years old and one archive that's one year old.
Author

Your best bet, if you can space the storage space, may be just to do keep_yearly: 2. That would keep one archive that's two years old and one archive that's one year old.

that's exactly what I was looking for. Thanks you sir.

> Your best bet, if you can space the storage space, may be just to do `keep_yearly: 2`. That would keep one archive that's two years old and one archive that's one year old. that's exactly what I was looking for. Thanks you sir.
Owner

Glad to hear it!

Glad to hear it!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#362
No description provided.