From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:48412) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ibhLL-0006G1-3t for guix-patches@gnu.org; Mon, 02 Dec 2019 03:46:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ibhLG-00075y-BG for guix-patches@gnu.org; Mon, 02 Dec 2019 03:46:07 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:59294) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ibhLG-00075s-86 for guix-patches@gnu.org; Mon, 02 Dec 2019 03:46:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ibhLG-0001aj-5b for guix-patches@gnu.org; Mon, 02 Dec 2019 03:46:02 -0500 Subject: [bug#38429] [PATCH] Add scron service. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20191129175356.12403-1-rob@vllmrt.net> <20191129180721.13923-1-rob@vllmrt.net> Date: Mon, 02 Dec 2019 10:01:56 +0100 In-Reply-To: <20191129180721.13923-1-rob@vllmrt.net> (Robert Vollmert's message of "Fri, 29 Nov 2019 19:07:22 +0100") Message-ID: <87r21nksmz.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Robert Vollmert Cc: 38429@debbugs.gnu.org Hello! Robert Vollmert skribis: > It's a simple replacement for the mcron service. > > If you have a mcron job definition like > > (define cron-job > #~(job "*/15 * * * *" #$(program-file ...))) > > you can convert it into the valid scron job > > (define cron-job > (scron-job (schedule "/15 * * * *") > (program-file ...))) Nice. > +(define scron-service-type > + (service-type (name 'scron) > + (extensions > + (list (service-extension shepherd-root-service-type > + scron-shepherd-services))) > + (compose concatenate) > + (extend (lambda (config jobs) > + (scron-configuration > + (inherit config) > + (jobs (append (scron-configuration-jobs confi= g) > + jobs))))) > + (default-value (scron-configuration)))) Could you add a =E2=80=98description=E2=80=99 field with a short blurb (you= can use Texinfo markup)? Also, could you add it to guix.texi, presumably under =E2=80=9CScheduled Job Execution=E2=80=9D? Last, it would be great if you could add a test, similar to the mcron test that=E2=80=99s in (gnu tests base). Thanks in advance! Ludo=E2=80=99.