🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: muc.lists.freebsd.current
Article #162

Re: Should we add jitter to cron(8) ?

#162
From: Ronald Klop
Date: Tue, 03 Nov 2026 11:56
105 lines
7390 bytes
------=_Part_1203_979822255.1793706969358
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Van: Don Lewis <truckman@FreeBSD.org>
Datum: maandag, 2 november 2026 19:27
Aan: Jamie Landeg-Jones <jamie@catflap.org>
CC: phk@phk.freebsd.dk, peterj@FreeBSD.org, current@FreeBSD.org
Onderwerp: Re: Should we add jitter to cron(8) ?
> 
> On  2 Nov, Jamie Landeg-Jones wrote:
> > Peter Jeremy <peterj@FreeBSD.org> wrote:
> >
> >> IMO, it would be useful to have a way of saying e.g. "run once an hour
> >> but I don't care when within the hour".
> >
> > I assume that the time within the hour would be the same each hour? If so,
> > that would be useful.
> >
> > But would than initial state random number be stored somewhere, or reset
> > each time cron starts?
> 
> ... and if cron gets restarted, could the job get run twice in that
> hour?
> 
>  
> 
> 
> 


Some inspirational thoughts.

OpenBSD already has a notation for random (~) in their crontab definition.
https://man.openbsd.org/crontab.5

And Jenkins (the CI/CD tool) can use a hash to get some "stable random" number for scheduling jobs.
"The H symbol can be thought of as a random value over a range, but it actually is a hash of the job name, not a random function, so that the value remains stable for any given project."
Examples like: H H(0-7) * * * or H/3, @hourly becomes H * * * *.

Regards,
Ronald.
 
------=_Part_1203_979822255.1793706969358
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<br />
<p><strong>Van:</strong> Don Lewis &lt;truckman@FreeBSD.org&gt;<br />
<strong>Datum:</strong> maandag, 2 november 2026 19:27<br />
<strong>Aan:</strong> Jamie Landeg-Jones &lt;jamie@catflap.org&gt;<br />
<strong>CC:</strong> phk@phk.freebsd.dk, peterj@FreeBSD.org, current@FreeBS=
D.org<br />
<strong>Onderwerp:</strong> Re: Should we add jitter to cron(8) ?</p>

<blockquote style=3D"padding-right: 0px; padding-left: 5px; margin-left: 5p=
x; border-left: #000000 2px solid; margin-right: 0px">
<div class=3D"MessageRFC822Viewer" id=3D"P">
<div class=3D"TextPlainViewer" id=3D"P.P">On &nbsp;2 Nov, Jamie Landeg-Jone=
s wrote:<br />
&gt; Peter Jeremy &lt;peterj@FreeBSD.org&gt; wrote:<br />
&gt;<br />
&gt;&gt; IMO, it would be useful to have a way of saying e.g. "run once an =
hour<br />
&gt;&gt; but I don't care when within the hour".<br />
&gt;<br />
&gt; I assume that the time within the hour would be the same each hour? If=
 so,<br />
&gt; that would be useful.<br />
&gt;<br />
&gt; But would than initial state random number be stored somewhere, or res=
et<br />
&gt; each time cron starts?<br />
<br />
... and if cron gets restarted, could the job get run twice in that<br />
hour?<br />
<br />
=C2=A0</div>

<hr /></div>
</blockquote>
<br />
<br />
Some inspirational thoughts.<br />
<br />
OpenBSD already has a notation for random (~) in their crontab definition.<=
br />
https://man.openbsd.org/crontab.5<br />
<br />
And Jenkins (the CI/CD tool) can use a hash to get some "stable random" num=
ber for scheduling jobs.<br />
"The <code>H</code> symbol can be thought of as a random value over a range=
, but it actually is a hash of the job name, not a random function, so that=
 the value remains stable for any given project."<br />
Examples like: H H(0-7) * * * or H/3, @hourly becomes H * * * *.<br />
<br />
Regards,<br />
Ronald.<br />
=C2=A0
------=_Part_1203_979822255.1793706969358--


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID: <2057997613.1204.1793706969390@localhost>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail
References: <tkrat.6aeca5ff117bbb87@FreeBSD.org> <>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail
From: Ronald Klop <ronald-lists@klop.ws>
Newsgroups: muc.lists.freebsd.current
Subject: Re: Should we add jitter to cron(8) ?
Date: Tue, 3 Nov 2026 12:56:09 +0100 (CET)
Organization: Newsgate at muc.de e.V.
Sender: owner-freebsd-current@FreeBSD.org
Approved: news-admin@muc.de
Distribution: world
Message-ID: <2057997613.1204.1793706969390@localhost>
References: <tkrat.6aeca5ff117bbb87@FreeBSD.org> <>
MIME-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_1203_979822255.1793706969358"
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
	logging-data="58226"; mail-complaints-to="news-admin@muc.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1793707000; h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:cc:mime-version:mime-version:
	 content-type:content-type:in-reply-to:in-reply-to:
	 references:references:list-id:list-help:list-owner:list-unsubscribe:
	 list-subscribe:list-post; bh=pFJGQx4cuP51LBftxjoQi/hrdo0V5QfTJ+FJMmYkDhw=;
	b=RhoMbgnOhipDa2vF3eHz38BgceBZMwG2J0p0KRqALHLktLFJGDcjPGFzgFv4N22VpTpWmx
	e/9VEALpzRSN8VVbkGyeharoMknmaqRrUb4VhxFge2SmpUiiSKueHcXA6mlnhB/j/jSKTn
	mbJcoRPGnbPxcX1vMOsVLuYp4FrbUvBbIRMojITjHbV0Hbt1Dy72Vp5EkO9AOT0t3Fiof/
	X6XeGMCSzAPxI1/gBZgJe8XOs9ArW3qchHvDMAEf0mTJkugU4COF1jfTMzJW358CCWQWe8
	pievk99588tpNwZP5uYbhJaHKmqQrc5DZNOMnb8/gmRAoXI60/juHDw5SVPz0Q==
X-Original-To: current@mlmmj.nyi.freebsd.org
Authentication-Results: mx1.freebsd.org;
	dkim=pass header.d=klop.ws header.s=rw2 header.b=CsPBIaan;
	spf=pass (mx1.freebsd.org: domain of ronald-lists@klop.ws designates 31.134.205.98 as permitted sender) smtp.mailfrom=ronald-lists@klop.ws;
	dmarc=pass (policy=quarantine) header.from=klop.ws
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=klop.ws; s=rw2;
	t=1793706970;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=pFJGQx4cuP51LBftxjoQi/hrdo0V5QfTJ+FJMmYkDhw=;
	b=CsPBIaan/+Upl6mmujG0gzukkDfSs+SNXkZNXPxdFU0YAbZ3rZ5JxHyMBeReLL+wZiorDH
	8xeTt7PthHQ0sdEp+a50mUh+yV55xU29swQrBwrEy5WKTIbIA42K5vhw1ZTV0jacT1DYxn
	1ES746D/DkbBCbfY8ZohzvL3zgE6THVoZ8bMbatSwYHf6Osyqch34X4lGKIavK4aCq2fSc
	p4g4O/PvuIirKagddMPgklnpw0Rnu9E0/D988ViO06Y/HLxXsEWpS9vkkBW2Lt1/fHpC9n
	J8IDl5nwpjzqWROUC+02CN1ULf9c1+bvPsuEjpnskNBvM1YBYzZ4ozwblnabcg==
In-Reply-To: <tkrat.6aeca5ff117bbb87@FreeBSD.org>
Precedence: list
Importance: Normal
X-Priority: 3 (Normal)
X-Rspamd-Queue-Id: 4jJn8y4fqnz4nk3
X-Spamd-Bar: /
X-Spamd-Result: default: False [0.60 / 15.00];
	SUBJECT_ENDS_QUESTION(1.00)[];
	DMARC_POLICY_ALLOW(-0.50)[klop.ws,quarantine];
	MID_RHS_NOT_FQDN(0.50)[];
	R_DKIM_ALLOW(-0.20)[klop.ws:s=rw2];
	R_SPF_ALLOW(-0.20)[+ip4:31.134.205.64/26];
	MIME_GOOD(-0.10)[multipart/alternative,text/plain];
	ONCE_RECEIVED(0.10)[];
	TO_DN_SOME(0.00)[];
	MIME_TRACE(0.00)[0:+,1:+,2:~];
	ARC_NA(0.00)[];
	ASN(0.00)[asn:51088, ipnet:31.134.200.0/21, country:NL];
	MLMMJ_DEST(0.00)[current@FreeBSD.org];
	RCPT_COUNT_FIVE(0.00)[5];
	FROM_HAS_DN(0.00)[];
	RCVD_COUNT_ZERO(0.00)[0];
	FROM_EQ_ENVFROM(0.00)[];
	TO_MATCH_ENVRCPT_SOME(0.00)[];
	HAS_X_PRIO_THREE(0.00)[3];
	DKIM_TRACE(0.00)[klop.ws:+]
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes