garethgeorge / backrest

Backrest is a web UI and orchestrator for restic backup.
GNU General Public License v3.0
787 stars 31 forks source link

No more weekly schedule after 1.0.0 #318

Closed vincios closed 19 hours ago

vincios commented 4 weeks ago

Describe the bug After the update to the version 1.0.0 there's no longer the "week" option under the cron dropdown, so it is not possible to set a schedule like "every Moday".

This also leads to some strange behaviors with plans created with versions before 1.0.

Issue 1 This plan scheduled "every Monday" before 1.0, now appears like this:

backrest_issue_1

Issue 2 For another plan that was scheduled, before 1.0, as "every 2 days" using weekdays, the config's cron expression was

"schedule": {
   "cron": "0 2 * * */2"
}

Now I have tried changing it to "every 2 days" but using the "month" option (selecting all the odd days) and the cron expression should become

"schedule": {
  "cron": "0 2 */2 * *"
}

but instead it becomes

"schedule": {
  "cron": "0 2 */2 * */2"
}

Note that this happens only editing a plan created before 1.0. If I create a new plan on the 1.0 version and I set it to "every 2 days" using the "month" option, the cron expression works as expected.

To Reproduce Steps to reproduce the behavior:

  1. On a version prior to 1.0 create a new plan
  2. Set the scheduling to "every 2 days" using the week option (i.e. by selecting Monday, Wednesday, Friday and Sunday)
  3. Save
  4. Update to a 1.0.x version
  5. Edit the same plan
  6. Set the schedule to "every 2 days" using the "month" option

Expected behavior The config's cron expression should change to

"schedule": {
  "cron": "0 2 */2 * *"
}

Platform Info

garethgeorge commented 4 weeks ago

Hmm, this was somewhat intentional (e.g. I was considering that weekly seemed redundant with a 4x monthly policy) -- but if there's demand for weekly I'm happy to bring that option back.

Re: the bug you're seeing, I suspect it can be worked around by clearing the value of the cron field (e.g. switching to a different schedule type or disabled and then switching back).

iksaku commented 4 weeks ago

I started using backrest right after 1.0 was released (coincidence) and thought that maybe weekly schedules were in future plans. IMHO, providing an option to directly schedule using a weekly strategy will be good enough for many (myself included). Consider this my support for bringing back the removed weekly option.

vincios commented 4 weeks ago

Hmm, this was somewhat intentional (e.g. I was considering that weekly seemed redundant with a 4x monthly policy) -- but if there's demand for weekly I'm happy to bring that option back.

Re: the bug you're seeing, I suspect it can be worked around by clearing the value of the cron field (e.g. switching to a different schedule type or disabled and then switching back).

Oh yeah, I suspected it was intentional (I opened the issue just to show the bugs).

I have some services scheduled to do their backup stuff on specific days of the weeks (for example, Home Assitant packs its backup tar every Monday), so if I want restic to be executed immediately after, then it is difficut to schedule using the month option.

For my use case, there is no problem to re-schedule these services on a monthly basis, but for someone else a weekly schedule could be useful (I imagine a company that plans its backups at the weekend, when there is no activity in the offices).

For the bugs, i'll try in a moment and let you know.

Thanks for the reply :)

vincios commented 4 weeks ago

I confirm that switching to a different schedule fix the issue, thanks for the tip!

For me the issue can be closed, just consider if (eventually) move it to a feature request.

garethgeorge commented 19 hours ago

Added back weekly support as of 1.1.0