1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
---
tags:
- systemd
---
Managed similarly to a unit. So we can start/stop/enable them etc.
List: `systemctl list-timers [--all]`
**Realtime Timers**; same as cron. Use `OnCalendar`
**Monotonic Timers**; Varying start point, then interval. E.g `OnBootSec` specifies start x seconds after boot.
Each `foo.timer` has a `foo.service` which it calls. Service doesn't need install section. Timer can call different unit by `[Timer] Unit=`
# Time span format
usec, us, μs
msec, ms
seconds, second, sec, s
minutes, minute, min, m
hours, hour, hr, h
days, day, d
weeks, week, w
months, month, M (defined as 30.44 days)
years, year, y (defined as 365.25 days)
# OnCalendar Format
`DayOfWeek Year-Month-Day Hour:Minute:Second`
```
OnCalendar=Mon,Tue *-*-01..04 12:00:00
OnCalendar=Sat *-*-1..7 18:00:00
OnCalendar=*-*-* 4:00:00
OnCalendar=Mon..Fri 22:30
OnCalendar=Sat,Sun 20:00
OnCalendar=*-*-* 02:00:00 Europe/Paris
```
---
https://wiki.archlinux.org/title/Systemd/Timers
https://man.archlinux.org/man/systemd.time.7
https://man.archlinux.org/man/systemd.timer.5
|