]>
Commit | Line | Data |
---|---|---|
ec1ae7e6 | 1 | .. _calendar-event-scheduling: |
1eff9a1e DC |
2 | |
3 | Calendar Events | |
4 | =============== | |
5 | ||
6 | Introduction and Format | |
7 | ----------------------- | |
8 | ||
9 | Certain tasks, for example pruning and garbage collection, need to be | |
34407477 | 10 | performed on a regular basis. `Proxmox Backup`_ Server uses a format inspired |
1eff9a1e DC |
11 | by the systemd Time and Date Specification (see `systemd.time manpage`_) |
12 | called `calendar events` for its schedules. | |
13 | ||
14 | `Calendar events` are expressions to specify one or more points in time. | |
3bbb70b3 | 15 | They are mostly compatible with systemd's calendar events. |
1eff9a1e DC |
16 | |
17 | The general format is as follows: | |
18 | ||
19 | .. code-block:: console | |
20 | :caption: Calendar event | |
21 | ||
22 | [WEEKDAY] [[YEARS-]MONTHS-DAYS] [HOURS:MINUTES[:SECONDS]] | |
23 | ||
24 | Note that there either has to be at least a weekday, date or time part. | |
25 | If the weekday or date part is omitted, all (week)days are included. | |
26 | If the time part is omitted, the time 00:00:00 is implied. | |
27 | (e.g. '2020-01-01' refers to '2020-01-01 00:00:00') | |
28 | ||
3bbb70b3 | 29 | Weekdays are specified with the abbreviated English version: |
1eff9a1e DC |
30 | `mon, tue, wed, thu, fri, sat, sun`. |
31 | ||
32 | Each field can contain multiple values in the following formats: | |
33 | ||
34 | * comma-separated: e.g., 01,02,03 | |
35 | * as a range: e.g., 01..10 | |
36 | * as a repetition: e.g, 05/10 (means starting at 5 every 10) | |
37 | * and a combination of the above: e.g., 01,05..10,12/02 | |
38 | * or a `*` for every possible value: e.g., \*:00 | |
39 | ||
2bc1250c | 40 | There are some special values that have a specific meaning: |
1eff9a1e DC |
41 | |
42 | ================================= ============================== | |
43 | Value Syntax | |
44 | ================================= ============================== | |
45 | `minutely` `*-*-* *:*:00` | |
46 | `hourly` `*-*-* *:00:00` | |
47 | `daily` `*-*-* 00:00:00` | |
48 | `weekly` `mon *-*-* 00:00:00` | |
49 | `monthly` `*-*-01 00:00:00` | |
3bbb70b3 | 50 | `yearly` or `annually` `*-01-01 00:00:00` |
1eff9a1e DC |
51 | `quarterly` `*-01,04,07,10-01 00:00:00` |
52 | `semiannually` or `semi-annually` `*-01,07-01 00:00:00` | |
53 | ================================= ============================== | |
54 | ||
55 | ||
56 | Here is a table with some useful examples: | |
57 | ||
58 | ======================== ============================= =================================== | |
59 | Example Alternative Explanation | |
60 | ======================== ============================= =================================== | |
61 | `mon,tue,wed,thu,fri` `mon..fri` Every working day at 00:00 | |
62 | `sat,sun` `sat..sun` Only on weekends at 00:00 | |
63 | `mon,wed,fri` -- Monday, Wednesday, Friday at 00:00 | |
64 | `12:05` -- Every day at 12:05 PM | |
65 | `*:00/5` `0/1:0/5` Every five minutes | |
66 | `mon..wed *:30/10` `mon,tue,wed *:30/10` Monday, Tuesday, Wednesday 30, 40 and 50 minutes after every full hour | |
67 | `mon..fri 8..17,22:0/15` -- Every working day every 15 minutes between 8 AM and 6 PM and between 10 PM and 11 PM | |
68 | `fri 12..13:5/20` `fri 12,13:5/20` Friday at 12:05, 12:25, 12:45, 13:05, 13:25 and 13:45 | |
69 | `12,14,16,18,20,22:5` `12/2:5` Every day starting at 12:05 until 22:05, every 2 hours | |
70 | `*:*` `0/1:0/1` Every minute (minimum interval) | |
71 | `*-05` -- On the 5th day of every Month | |
72 | `Sat *-1..7 15:00` -- First Saturday each Month at 15:00 | |
73 | `2015-10-21` -- 21st October 2015 at 00:00 | |
74 | ======================== ============================= =================================== | |
75 | ||
76 | ||
77 | Differences to systemd | |
78 | ---------------------- | |
79 | ||
80 | Not all features of systemd calendar events are implemented: | |
81 | ||
3bbb70b3 | 82 | * no Unix timestamps (e.g. `@12345`): instead use date and time to specify |
1eff9a1e | 83 | a specific point in time |
2bc1250c | 84 | * no timezone: all schedules use the timezone of the server |
1eff9a1e DC |
85 | * no sub-second resolution |
86 | * no reverse day syntax (e.g. 2020-03~01) | |
87 | * no repetition of ranges (e.g. 1..10/2) | |
88 | ||
2bc1250c | 89 | Notes on Scheduling |
1eff9a1e DC |
90 | ------------------- |
91 | ||
34407477 | 92 | In Proxmox Backup, scheduling for most tasks is done in the |
1eff9a1e | 93 | `proxmox-backup-proxy`. This daemon checks all job schedules |
2bc1250c | 94 | every minute, to see if any are due. This means that even though |
1eff9a1e | 95 | `calendar events` can contain seconds, it will only be checked |
2bc1250c | 96 | once per minute. |
1eff9a1e DC |
97 | |
98 | Also, all schedules will be checked against the timezone set | |
34407477 | 99 | in the Proxmox Backup Server. |