New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect scheduling of "first weekly backup in month/year" #217

Closed
digint opened this Issue Apr 5, 2018 · 2 comments

Comments

Projects
None yet
1 participant
@digint
Owner

digint commented Apr 5, 2018

In the scheduler, a month (or year) does not start at the first day, but at the first preserve_day_of_week. When determining the "first weekly backup in month", the scheduler looks for "the first weekly backup which has a timestamp within the given month" instead of "the first weekly backup which has a timestamp within the given month starting at preserve_day_of_week". This affects scheduling (creation as well as deletion) of snapshots, backups and archives.

Steps to reproduce

  • preserve_day_of_week sunday
  • target_preserve *m
  • no backups in 2018-02
  • backup with timestamp 2018-03-01 (which is a thursday)
  • backup with timestamp 2018-03-04 (which is a sunday)

Expected results

  • discard backup with timestamp 2018-03-01
  • preserve backup with timestamp 2018-03-04 (as it is "first weekly (on sunday) backup of 2018-03")

Actual results

Because there are no sunday backups in 2018-02, the first backup is considered a weekly (+4d after sunday), and as such "first weekly of month 2018-03", and the second one is discarded.

Versions

  • btrbk <= 0.26.1

@digint digint added the bug label Apr 5, 2018

@digint

This comment has been minimized.

Owner

digint commented Apr 5, 2018

Fixed in 719fb5f

Note this change may result in (previously preserved) backups to be deleted!

@digint

This comment has been minimized.

Owner

digint commented Oct 16, 2018

Included in btrbk-0.27.0

@digint digint closed this Oct 16, 2018

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