{"action":"created","issue":{"url":"https://api.github.com/repos/digint/btrbk/issues/217","repository_url":"https://api.github.com/repos/digint/btrbk","labels_url":"https://api.github.com/repos/digint/btrbk/issues/217/labels{/name}","comments_url":"https://api.github.com/repos/digint/btrbk/issues/217/comments","events_url":"https://api.github.com/repos/digint/btrbk/issues/217/events","html_url":"https://github.com/digint/btrbk/issues/217","id":311625100,"number":217,"title":"incorrect scheduling of \"first weekly backup in month/year\"","user":{"login":"digint","id":7590973,"avatar_url":"https://avatars0.githubusercontent.com/u/7590973?v=4","gravatar_id":"","url":"https://api.github.com/users/digint","html_url":"https://github.com/digint","followers_url":"https://api.github.com/users/digint/followers","following_url":"https://api.github.com/users/digint/following{/other_user}","gists_url":"https://api.github.com/users/digint/gists{/gist_id}","starred_url":"https://api.github.com/users/digint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digint/subscriptions","organizations_url":"https://api.github.com/users/digint/orgs","repos_url":"https://api.github.com/users/digint/repos","events_url":"https://api.github.com/users/digint/events{/privacy}","received_events_url":"https://api.github.com/users/digint/received_events","type":"User","site_admin":false},"labels":[{"id":175690918,"url":"https://api.github.com/repos/digint/btrbk/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-05T14:06:17Z","updated_at":"2018-04-05T16:15:51Z","closed_at":null,"author_association":"OWNER","body":"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.\r\n\r\n#### Steps to reproduce\r\n  - `preserve_day_of_week  sunday`\r\n  - `target_preserve  *m`\r\n  - no backups in 2018-02\r\n  - backup with timestamp 2018-03-01 (which is a thursday)\r\n  - backup with timestamp 2018-03-04 (which is a sunday)\r\n\r\n#### Expected results\r\n  - discard backup with timestamp 2018-03-01\r\n  - preserve backup with timestamp 2018-03-04 (as it is \"first weekly (on sunday) backup of 2018-03\")\r\n\r\n#### Actual results\r\n\r\nBecause 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.\r\n\r\n### Versions\r\n- btrbk <= 0.26.1\r\n"},"comment":{"url":"https://api.github.com/repos/digint/btrbk/issues/comments/378992002","html_url":"https://github.com/digint/btrbk/issues/217#issuecomment-378992002","issue_url":"https://api.github.com/repos/digint/btrbk/issues/217","id":378992002,"user":{"login":"digint","id":7590973,"avatar_url":"https://avatars0.githubusercontent.com/u/7590973?v=4","gravatar_id":"","url":"https://api.github.com/users/digint","html_url":"https://github.com/digint","followers_url":"https://api.github.com/users/digint/followers","following_url":"https://api.github.com/users/digint/following{/other_user}","gists_url":"https://api.github.com/users/digint/gists{/gist_id}","starred_url":"https://api.github.com/users/digint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digint/subscriptions","organizations_url":"https://api.github.com/users/digint/orgs","repos_url":"https://api.github.com/users/digint/repos","events_url":"https://api.github.com/users/digint/events{/privacy}","received_events_url":"https://api.github.com/users/digint/received_events","type":"User","site_admin":false},"created_at":"2018-04-05T16:15:51Z","updated_at":"2018-04-05T16:15:51Z","author_association":"OWNER","body":"Fixed in 719fb5fb7470df7f610fd190985765c71a2698e2\r\n\r\nNote this change may result in (previously preserved) backups to be deleted!"}}
{"actor":{"display_login":"digint"}}