From 4223e9afd4401bd930ca815ffa816eb76fad83f6 Mon Sep 17 00:00:00 2001 From: Jasper Ras Date: Wed, 30 Apr 2025 15:14:56 +0200 Subject: vault backup: 2025-04-30 15:14:56 --- Systemd timer.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Systemd timer.md (limited to 'Systemd timer.md') diff --git a/Systemd timer.md b/Systemd timer.md new file mode 100644 index 0000000..72f50b8 --- /dev/null +++ b/Systemd timer.md @@ -0,0 +1,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 \ No newline at end of file -- cgit v1.2.3