Skip to content

Docs: clarify filtering of archives during borg backup pruning#7616

Merged
szaimen merged 3 commits into
nextcloud:mainfrom
th0rgall:patch-1
Feb 17, 2026
Merged

Docs: clarify filtering of archives during borg backup pruning#7616
szaimen merged 3 commits into
nextcloud:mainfrom
th0rgall:patch-1

Conversation

@th0rgall
Copy link
Copy Markdown
Contributor

@th0rgall th0rgall commented Feb 17, 2026

Clarify the retention policy adjustment instructions by mentioning to not include the '-a' or '--glob-archives' option.

I included --glob-archives="*-nextcloud-aio" the retention policy env variable, and it lead to a borg pruning error due a the duplicate -a ... --glob-archives options. Only one of these options can be provided, since they are the same, and borg doesn't accept duplicates.

I added --glob-archives to the retention policy because I didn't know that AIO already provided it by default, and I was worried that it would prune out other non-Nextcloud-AIO backups in the repo. The solution was to remove my unnecessary addition.

At the moment of writing, these are the default prune options in AIO:

if ! borg prune --stats --glob-archives '*_*-nextcloud-aio' "${BORG_PRUNE_OPTS[@]}"; then

This PR is the smallest addition I could think of to clarify that filtering is built-in.

As an alternative to this edit, Nextcloud AIO's default filtering behavior could be clarified elsewhere is a positive way.

Two ideas:

  1. Modify the start of the retention policy FAQ answer, like:

    After a backup, AIO prunes your borg archives with the --glob-archives '*_*-nextcloud-aio' option, so that it does not affect archives unrelated to AIO. The built-in retention policy is --keep-within=7d --keep-weekly=4 --keep-monthly=6. [...]

  2. Or perhaps, there can be another FAQ question about backups, like "Will Nextcloud AIO touch other backups in my borg repository?" or "Can I use my borg repository for backups unrelated to Nextcloud AIO?", with the answer:

    No/Yes, AIO internally uses the borg --glob-archives '*_*-nextcloud-aio' option to only prune AIO archives, so Nextcloud AIO will not affect archives/backups unrelated to AIO. Be careful that other systems don't prune your AIO archives, however.

Clarify the retention policy adjustment instructions by mentioning to not include the '-a' or '--glob-archives' option.

I recently included in the retention policy env variable, and it lead to a pruning error due to the duplicate `-a` ... `--glob-archives` options. I added it because I didn't know that AIO already filtered archives in the borg repo during pruning, and I was worried that it would prune out other non-Nextcloud-AIO backups in the repo. I added a very similar glob myself, so just omitting what I added was the solution for my problem.

As an alternative to this edit, I was thinking that Nextcloud AIO's default filtering behavior could be clarified elsewhere is a positive way.

Two ideas:

1. Modify the start of the retention policy FAQ, like:
   
   After a backup, AIO prunes your borg archives with the `--glob-archives '*_*-nextcloud-aio'` option, so that it does not affect archives unrelated to AIO. The built-in retention policy is `--keep-within=7d --keep-weekly=4 --keep-monthly=6`. [...]
   
2. Or perhaps, there can be another FAQ question about backups, like "Will Nextcloud AIO touch other backups in my borg repository?" or "Can I use my borg repository for backups unrelated to Nextcloud AIO?", with the answer:

   No/Yes, AIO internally uses the borg `--glob-archives '*_*-nextcloud-aio'` option to only prune AIO archives, so Nextcloud AIO will not affect archives/backups unrelated to AIO. Be careful that other systems don't prune your AIO archives, however.

Signed-off-by: Thor Galle <[email protected]>
Signed-off-by: Thor Galle <[email protected]>
@szaimen szaimen added 3. to review Waiting for reviews documentation Improvements or additions to documentation labels Feb 17, 2026
@szaimen szaimen added this to the next milestone Feb 17, 2026
Copy link
Copy Markdown
Collaborator

@szaimen szaimen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the PR! :)

I have one suggestion below

Comment thread readme.md Outdated
Co-authored-by: Simon L. <[email protected]>
Signed-off-by: Thor Galle <[email protected]>
Copy link
Copy Markdown
Collaborator

@szaimen szaimen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! ☺️

@szaimen szaimen merged commit cf507d6 into nextcloud:main Feb 17, 2026
2 of 3 checks passed
@th0rgall
Copy link
Copy Markdown
Contributor Author

Thanks for reviewing this so quickly! I like the idea of simply linking to this PR for more context, rather than a code line that may get outdated. I'll still add that line in the opening post of this PR for clarification, since it's now used as a reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants