Redesign Schedule section in the GUI
Blocked by:
- #1850
- #1984
- And maybe some more refactoring stuff that need to be done beforehand.
This is based on PR #1196 where it comes up that it might be a good idea to re-design the part of the GUI responsible for scheduling.
Current situation
Currently it is just a drop down menu in the "General" tab of the "Settings" dialog of the profile settings.
Problems
- Now way to add "time restrictions" like hours where the job never should run. This is was PR #1196 originally was about.
- Cron and Anacron like schedule options are mixed. To complex and hard to understand for some users now aware of the difference between cron and anacron. Some user might not understand that some jobs are missing when using "Every 6 hours" (cronlike).
- Anacron is named in the dialog. But for real BIT do not use anacron but just simulate the anacron like behavior.
- An "export" option is missing to create a user defined crontab line.
Proposal
This is a quick and dirty (not finished) proposal in form of a GUI MockUp (used draw.io for that). I attached the original file if you like to edit.
- I tried to reflect nearly the same behavior as in the current Schedule GUI. Exceptions are noted below.
- Removed scheduling from "General" tab and created an extra tab "Schedule" for it.
- Removed all crontab-based options (e.g. "Every 6 hours") because of the assumption that most users do misunderstand them and don't know that it means specific time points (e.g. 0:00, 6:00, 12:00, ...) and they would miss them if the machine isn't running.
- Technical details (cron, anacron, etc pp) could be added as tooltips.
- The tab now has 5 sections where only one of them can be active.
- "Run peridically after" is related to the anacron-like behavior. It means timespans.
- "On reboot" is cron and using
@reboot. The "delay" is new and would be realized with asleep n && backintimelike cron command. - "Every day/week/month/year" is related to cron and results in usual crontab lines. Of the 4 variants only one is visible depending on the value selected in the dropdown menu.
- "When drive get connected" use udev.
- "Expert/cronline" is new and opens the opportunity to advanced users creating their own crontab line. Maybe this could be somehow improved with 5 separated line edits etc.
- The solution should be separated into multiple PR's of course.
- See Qt classes
QDateTimeEdit,QTimeEdit
Here are some variants and annotations in the picture.
To see how it could look like for real here is a version without annotations just using the week-variant in the third section.
Here is the original DrawIO file (ZIP because of Microsoft GitHub. You need to unpack before open with drawio). backintime_schedule_mockup.drawio.zip
Related:
- #2018
Great work! Here's a few minor improvements in wording, and making refinements for the different scenarios optional with checkboxes:
@buhtz Amazing work, your mock-up GUI! This makes the available options much more visible to end users than hiding then in a combo box (as is now).
I think an anacron-alike scheduling option to create overdue snapshots when the computer is switched on would be great too but we have to discuss then first
- what exactly the current
anacronscheduling implementation is in Bit is doing (the option is named "repeatedly (anacron)" - whatever this is) - how reliable it is (there are other issues related to anchron)
- if we should restrict the
anacronscheduling to pure "take overdue snapshots when computer is switched on/user is logging on" or to support allanacronfeatures.
No need to discuss this right now IMHO (let's wait until we plan the implementation...?!)
Moin moin,
thanks for your thoughts.
- what exactly the current
anacronscheduling implementation is in Bit is doing (the option is named "repeatedly (anacron)" - whatever this is)
Michael explained that on the mailing list and I remember I have heard that somehow in the past also; maybe from Germar. When an anacron-like schedule is configured BIT add a crontab line that starts it every 15 minutes. Then BIT checks itself if it is time to run a job or not. If not it just close itself again. Not totaly elegant but it seems to works. How all this is implemented in the back is of course another issue. Today there is also the option of systemd timers, etc pp. BIT could react flexibel depending on what the system offers; e.g. some OS don't have systemd.
Maybe @Germar can explain why anacron is not used.
- how reliable it is (there are other issues related to anchron)
I couldn't find and I'm not aware of Issues related to (ana)cron.
- if we should restrict the
anacronscheduling to pure "take overdue snapshots when computer is switched on/user is logging on" or to support allanacronfeatures.
I shouldn't use the term "anacron" anymore. I don't know about other anacron features. I just like the idea of configuring timespan and that "anacron" catch the job up when the timespan elapsed.
When communicating with the user I also wouldn't use technical terms like "cron" or "anacron". I only would describe the behaviour in the GUI not the technology behind.
The possibility to edit the full cron line is very nice, this allows a high flexibility. For me it is also fine to be able to specify the cron line in the config file directly (not via the GUI). This might ease everything. The important thing for me is to have a fairly good control over the cron line.
Just as a note. The possible options are hard coded in the config.
Take into account the discussion in #1479 which is about how to handle and configure the retry-behavior in case of errors and unsuccesfull snapshots.