Time-based execution of programs and scripts
There are two main ways to execute a script at a specific time, which we will review in this section. The first is based on a cron package, and the second is based on systemd timers. The systemd and process basics described in Chapter 13 are essential in both cases. While using cron is simpler, it is started at a certain moment during the OS initialization sequence, so cron jobs can only be triggered after this.
A specific time means at an exact calendar time, such as 10.12.2023 at 23.45 UTC, supported by both cron and systemd.
The other way is based on timers, offered only by systemd. A timer is a hardware or software module that can trigger events based on an elapsed time period – for example, every 35 seconds or every 75th hour. These are often called monotonic timers and are configurable; we can set their activation period to custom values.
The initial release of cron was for Unix in May 1975. Multiple posts on the internet...