7.3 Schedule rules
The schedule kind Rules (several times and types) combines several times, weekdays, and backup types in one schedule, for example "Monday to Friday incremental, on the first Sunday of the month full". Rules are available in the job editor and in the plan editor (there as Own rules (times, days, types), see section 7.6 Plans).
Structure of a rule
Each rule occupies one row in the editor. A schedule consists of 1 to 20 rules.
Field in the editor | Effect | Default |
|---|---|---|
Type (selector at the start of the row) | Backup type of the runs this rule triggers: Incremental, Differential, Full, or Synthetic full (see section 7.2 Backup types). For workloads without backup types the row shows only "Backup", and the normal backup always runs | Incremental |
Weekdays (Mon to Sun) | Days on which the rule applies. Multiple selection. With nothing selected, the rule applies every day | Mon-Fri for a new rule |
Week (selector) | Restricts the rule to certain occurrences of the weekday in the month, see below | every week |
Times | One or more times of day (server time), separated by comma, space, or semicolon, for example | 22:00 for a new rule |
The button with the cross at the end of the row removes the rule. The context menu of a rule (right-click) offers Remove rule as well; Copy times puts the rule's times on the clipboard.
The "Week" selector
The selector refers to the occurrence of the weekday within the month. The "1st Sunday" is the Sunday on days 1 to 7 of the month; the "last" one is the Sunday after which no other follows in that month.
Entry | Effect | Value in the stored schedule |
|---|---|---|
every week | every occurrence | no restriction |
1st in month, 2nd in month, 3rd in month, 4th in month | only the 1st, 2nd, 3rd, or 4th occurrence |
|
last in month | only the last occurrence |
|
except 1st | all occurrences except the 1st |
|
except last | all occurrences except the last |
|
days of month… | replaces weekdays and week with fixed calendar days |
|
With days of month…, an input field for calendar days appears instead of the weekdays, for example 1, 15, last. 1 to 31 are allowed; "last" stands for 31 and hits the last day of shorter months. In this mode weekdays and the week selection are not evaluated.
Beyond the interface, the stored schedule also allows the 5th occurrence (5) and several values in weeks or except_weeks. A rule that excludes every week it selects is rejected.
Buttons below the rules
Button | Effect |
|---|---|
Rule | adds a rule: Incremental, Mon-Fri, 22:00 |
Example: office week | replaces the rules with the example below (only for workloads with backup types) |
Next: | shows the next six runs with date, time, and type abbreviation (inc, diff, full, synth), calculated by the server. This lets you check the schedule before saving. If the schedule has an error, the error message appears here |
Below that, a note reminds you of the precedence of the types (with more than one rule) or that no selected days means every day.
Several rules and the precedence of types
If several rules hit the same minute, one run starts with the strongest type:
Full › Synthetic full › Differential › Incremental
The server derives the next appointment from all rules: starting today, it searches day by day (up to 400 days ahead, so that rare combinations such as a 5th Sunday are found) for the earliest time that at least one rule hits. When the run is created, its type is determined from all rules that hit that minute.
Catching up (see section 7.5 Power, Wake-on-LAN and catch-up) follows the same precedence: the one caught-up run gets the strongest type of all missed appointments, so a missed Full is not lost.
The time window Only start between and the option Catch up missed runs after server downtime (see section 7.1 Schedule kinds) also apply to rule schedules.
Example "office week"
The button Example: office week fills in four rules. The included plan "Office week (mixed types)" supplies the same rules.
Type | Days | Week | Times |
|---|---|---|---|
Full | Sun | 1st in month | 14:00 |
Incremental | Mon-Fri | every week | 08:00, 16:00 |
Differential | Wed | every week | 12:00 |
Synthetic full | Sun | except 1st | 14:00 |
The result: an incremental backup in the morning and afternoon on weekdays, an additional differential at noon on Wednesdays, a real full backup on the first Sunday of a month, and a synthetic full without load on the machines on the other Sundays.
More examples
Goal | Rules |
|---|---|
Incremental at night, full on Sundays | Full, Sun, every week, 02:00 and Incremental, Mon-Sat, every week, 02:00 |
Three times a day during working hours | Incremental, Mon-Fri, every week, 08:00, 12:00, 18:00 |
Full on the 1st of the month, otherwise incremental daily | Full, days of month… |
Full on the last Friday of the month | Full, Fri, last in month, 20:00 and Incremental, Mon-Thu, every week, 20:00 |
Synthetic full on Saturdays after the backup | Incremental, Mon-Sat, every week, 01:00 and Synthetic full, Sat, every week, 06:00 |
Two rules in the same minute | Full, Sun, 1st in month, 14:00 and Synthetic full, Sun, every week, 14:00: on the 1st Sunday only the Full backup runs |
In the third example, two runs occur on the 1st of the month because the times differ (03:00 full, 22:00 incremental). If the incremental rule were also at 03:00, only the full backup would run that day.
Rule schedules in the REST API
The REST API accepts the schedule as JSON. The fields of a rule are backup_type (incremental, differential, full, synthetic_full), times, days (mon to sun), weeks, except_weeks, and month_days. The server rejects unknown fields in a rule.
{"type": "rules", "catch_up": true, "rules": [
{"backup_type": "full", "days": ["sun"], "weeks": [1], "times": ["14:00"]},
{"backup_type": "incremental", "days": ["mon","tue","wed","thu","fri"], "times": ["08:00","16:00"]},
{"backup_type": "differential", "days": ["wed"], "times": ["12:00"]},
{"backup_type": "synthetic_full", "days": ["sun"], "except_weeks": [1], "times": ["14:00"]}
]}