Skip to content

Refactor the interval-based pruning example#1

Open
PhrozenByte wants to merge 1 commit into
Goddesen:prune-timely-by-intervalfrom
PhrozenByte:Goddesen/prune-timely-by-interval
Open

Refactor the interval-based pruning example#1
PhrozenByte wants to merge 1 commit into
Goddesen:prune-timely-by-intervalfrom
PhrozenByte:Goddesen/prune-timely-by-interval

Conversation

@PhrozenByte

Copy link
Copy Markdown

See my review on borgbackup#8775

Comment on lines +103 to +104
2026-05-28 16:00 is exactly one week before `--since`. Since `create` always
runs at or after 16:00, the archive created on 2026-05-28 is kept, too. Without

@Goddesen Goddesen Jun 14, 2026

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

"at or after" ensuring the week-old archive is kept isn't quite right since the interval end is compared exclusively to the archive time (and archive time is at the start of the create call). With microsecond precision this might not matter in most cases, but it's worth clearing up either this text and the example -- or maybe this is an argument to make the comparison inclusive such that this wording works.

I think that the exclusive check is technically right, but in practice it might be too much hassle for users.

Comment on lines +4 to +7
Assume today is 2026-06-04 and you always start your backups at 16:00. You have
been creating backup archives starting at 16:00 on most days going back to late
2025. Today, `create` took a little longer than usual. It's 16:12 now and you
run `prune`.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I think an extra intro paragraph to set up the scenario is nice. Just launching into "you start your backups" is a bit abrupt.

Suggested change
Assume today is 2026-06-04 and you always start your backups at 16:00. You have
been creating backup archives starting at 16:00 on most days going back to late
2025. Today, `create` took a little longer than usual. It's 16:12 now and you
run `prune`.
Scenario: You use borg to perform daily backups. The changes day-to-day are less
important as time goes on, so to save some storage space you have the older
archives "thin out" over time while keeping most of the recent archives. Your
backup script does `borg create ...` followed immediately by `borg prune ...`.
Assume today is 2026-06-04 and you start your backups at 16:00. You have been
creating backup archives starting at 16:00 on most days going back to late 2025.
Today, `borg create` took a little longer than usual. It's 16:12 now and you run
`borg prune`.

@Goddesen

Copy link
Copy Markdown
Owner

These are good suggestions. If you agree with my comments I'll merge it right in.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants