Timers also let you logical-AND elements within one simple declaration. Combine that with a random delay, and you can easily define a trigger such as "the 2nd Saturday of the month, anytime between midnight and 6AM":
You can tell a timer whether to re-use that same randomly-selected time during subsequent runs (FixedRandomDelay), or to re-roll the time for every trigger. They can also persist their last-run history across reboots, and trigger if they missed their previous time-slot.
The improved logic vs. cron is one of the features which makes my life easier, and so I started using systemd more often. IMHO some of the newer additions aren't quite as solid; but the basic units have proven to be very handy. Another example: The 'path' unit, which can trigger whenever a defined file is updated.
The improved logic vs. cron is one of the features which makes my life easier, and so I started using systemd more often. IMHO some of the newer additions aren't quite as solid; but the basic units have proven to be very handy. Another example: The 'path' unit, which can trigger whenever a defined file is updated.
https://wiki.archlinux.org/title/Systemd/Timers