Gentoo Archives: gentoo-user

From: Marc Joliet <marcec@×××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] using systemd timers as a cron replacement
Date: Sun, 23 Aug 2015 20:23:59
Message-Id: 20150823222346.478ceb83@thetick
In Reply to: Re: [gentoo-user] using systemd timers as a cron replacement by allan gottlieb
1 Am Sun, 23 Aug 2015 10:38:23 -0400
2 schrieb allan gottlieb <gottlieb@×××.edu>:
3
4 > Thank you marc and fernando (fernando, I think your replies go only to
5 > marc and not to the group).
6 >
7 > So it seems the conclusion is timers can't achieve both
8 > 1. Run only once a day even if you boot often.
9 > 2. Not starting for at least 10 minutes after boot
10 >
11 > I realize that you can achieve 2 outside the timer by having services
12 > fired by the timer begin with a 10 minute delay.
13 >
14 > However, I thought timers were supposed to achieve 1 & 2, since that is
15 > what I believe you get with vixie-cron + anacron.
16 >
17 > Also, since systemd.cron is based on timers, I would think it would have
18 > the same problem we are discussing.
19 >
20 > allan
21
22 FWIW, this is also mentioned in the anacrontab(5) man page that comes with
23 systemd-cron:
24
25 "There are subtle differences on how anacron & systemd handle persistente timers: anacron will run a weekly job at most once a week, with allways a minimum delay of 6 days between runs; where systemd will try to run it every monday at 00:00; or as soon the system boot. In the most extreme case, if a system was only started on sunday; a weekly job will run this day and the again the next (mon)day.
26 With carefull manual settings, it would be possible to run the real anacron binary (not your distro's package) with systemd-cron; if you need an identical behaviour.
27 There is no difference for the daily job."
28
29 I have no idea about the last sentence, since I observe the exact same
30 behaviour with persistent daily timers.
31
32 HTH
33 --
34 Marc Joliet
35 --
36 "People who think they know everything really annoy those of us who know we
37 don't" - Bjarne Stroustrup

Replies

Subject Author
Re: [gentoo-user] using systemd timers as a cron replacement allan gottlieb <gottlieb@×××.edu>