Skip to content
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

New schedule section for configuration v2 #146

Closed
wants to merge 1 commit into from

Conversation

creativeprojects
Copy link
Owner

@creativeprojects creativeprojects commented Oct 27, 2022

This PR is adding support for the schedules section on the configuration format v2:

schedules:
    full-backup: # give a name to your schedule
        group: full
        schedule:
            - "Mon..Fri *:00,15,30,45" # every 15 minutes on weekdays
        permission: user
        run: backup # backup is the default if not specified

    other:
        profiles:
            - root
            - mysql
        schedule:
            - "Sat,Sun 0,12:00" # twice a day on week-ends
        permission: user
        run: prune
  • Implementation
  • Tests
  • Documentation
  • Ready for review

@creativeprojects creativeprojects marked this pull request as draft October 27, 2022 22:01
@codecov
Copy link

codecov bot commented Oct 27, 2022

Codecov Report

Patch coverage: 51.48% and project coverage change: -0.12% ⚠️

Comparison is base (b00c8a0) 77.20% compared to head (12e29b0) 77.09%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #146      +/-   ##
==========================================
- Coverage   77.20%   77.09%   -0.12%     
==========================================
  Files          92       93       +1     
  Lines        9949    10020      +71     
==========================================
+ Hits         7681     7724      +43     
- Misses       2003     2032      +29     
+ Partials      265      264       -1     
Flag Coverage Δ
unittests 77.09% <51.48%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
config/schedule_config.go 75.61% <0.00%> (+15.99%) ⬆️
schedule/handler_crond.go 12.73% <0.00%> (ø)
config/info.go 93.06% <14.29%> (-1.30%) ⬇️
schedule/handler_systemd.go 19.25% <16.67%> (ø)
schtasks/taskscheduler.go 47.80% <16.67%> (ø)
config/schedule.go 28.21% <28.21%> (ø)
schedule_jobs.go 30.36% <33.33%> (ø)
commands.go 53.72% <50.00%> (+0.04%) ⬆️
schedule/handler_darwin.go 49.58% <50.00%> (ø)
schedule/handler_windows.go 26.67% <50.00%> (ø)
... and 6 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@creativeprojects
Copy link
Owner Author

creativeprojects commented May 6, 2023

I finally got a bit of time to do some work on the new scheduling configuration.

@jkellerer I wanted to discuss a few options before I go further. The way we call resticprofile from the scheduler will have to change. That's because we allow a list of profiles to be part of the schedule (which I think is a good thing anyway).

From now I can see two options:

  • add a --profiles profile1,profile2 option. This is the closest to the current implementation. We can change the name of the schedule and it's still going to work. The schedule configuration is transformed into command line flags. If we change the list of profile we have to unschedule and schedule again.
  • add a --run-schedule name option. With this option we don't need to transform the configuration into flags. We just need to read the schedule section when we start the job. This is a bit different than what we do now but it would make it much easier to change the configuration without rescheduling the jobs. One drawback though is that we cannot change the name of the schedule.

By writing it I realise I like the second option a bit more, but I wanted to have your opinion on it 😉

@jkellerer
Copy link
Collaborator

Reading it, intuitively, I also like option 2 more (before reading the last line 😀). So looks like we're on the same page.

@jkellerer
Copy link
Collaborator

jkellerer commented May 6, 2023

Regarding the name.. I was thinking that it might be something to consider to have kind of cache and/or state storage which might be used for all sorts of things including detecting name changes.

While it may not help now, we could use it later to automatically act when name changes are detected (not only in this case). So it may not necessarily be a disadvantage.

@creativeprojects
Copy link
Owner Author

Replaced by #333

@creativeprojects creativeprojects deleted the schedule-v2 branch March 13, 2024 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants