From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: mcron service Date: Thu, 23 Jun 2016 10:18:04 +0200 Message-ID: <877fdgs4hv.fsf_-_@gnu.org> References: <20160430192744.1fbe081f@scratchpost.org> <871t5lc432.fsf@gnu.org> <20160517192857.0bab0560@scratchpost.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFzq0-0000j8-FJ for guix-devel@gnu.org; Thu, 23 Jun 2016 04:18:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFzpw-0005b9-9b for guix-devel@gnu.org; Thu, 23 Jun 2016 04:18:11 -0400 In-Reply-To: <20160517192857.0bab0560@scratchpost.org> (Danny Milosavljevic's message of "Tue, 17 May 2016 19:28:57 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Danny Milosavljevic Cc: guix-devel@gnu.org Hi! Commit c311089b0b19f094e44d3f858c29f77d757332d1 adds =E2=80=98mcron-service= =E2=80=99. If you want to give it a try, your feedback is welcome! Excerpt from the manual below. Ludo=E2=80=99. 7.2.7.2 Scheduled Job Execution ............................... The =E2=80=98(gnu services mcron)=E2=80=99 module provides an interface to = GNU mcron, a daemon to run jobs at scheduled times (*note (mcron)Top::). GNU mcron is similar to the traditional Unix =E2=80=98cron=E2=80=99 daemon; the main = difference is that it is implemented in Guile Scheme, which provides a lot of flexibility when specifying the scheduling of jobs and their actions. For example, to define an operating system that runs the =E2=80=98update= db=E2=80=99 (*note (find)Invoking updatedb::) and the =E2=80=98guix gc=E2=80=99 command= s (*note Invoking guix gc::) daily: (use-modules (guix) (gnu) (gnu services mcron)) (define updatedb-job ;; Run 'updatedb' at 3 AM every day. #~(job '(next-hour '(3)) "updatedb --prunepaths=3D'/tmp /var/tmp /gnu/store'")) (define garbage-collector-job ;; Collect garbage 5 minutes after midnight every day. #~(job "5 0 * * *" ;Vixie cron syntax "guix gc -F 1G")) (operating-system ;; ... (services (cons (mcron-service (list garbage-collector-job updatedb-job)) %base-services))) *Note mcron job specifications: (mcron)Guile Syntax, for more information on mcron job specifications. Below is the reference of the mcron service. -- Scheme Procedure: mcron-service JOBS [#:mcron MCRON2] Return an mcron service running MCRON that schedules JOBS, a list of gexps denoting mcron job specifications. This is a shorthand for: (service mcron-service-type (mcron-configuration (mcron mcron) (jobs jobs))) -- Scheme Variable: mcron-service-type This is the type of the =E2=80=98mcron=E2=80=99 service, whose value i= s an =E2=80=98mcron-configuration=E2=80=99 object. This service type can be the target of a service extension that provides it additional job specifications (*note Service Composition::). In other words, it is possible to define services that provide addition mcron jobs to run. -- Data Type: mcron-configuration Data type representing the configuration of mcron. =E2=80=98mcron=E2=80=99 (default: MCRON2) The mcron package to use. =E2=80=98jobs=E2=80=99 This is a list of gexps (*note G-Expressions::), where each gexp corresponds to an mcron job specification (*note mcron job specifications: (mcron)Syntax.).