From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id cJZYFLtCB2YWhgEAqHPOHw:P1 (envelope-from ) for ; Fri, 29 Mar 2024 23:37:47 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id cJZYFLtCB2YWhgEAqHPOHw (envelope-from ) for ; Fri, 29 Mar 2024 23:37:47 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=NEMkl1iN; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1711751867; a=rsa-sha256; cv=none; b=Z+/ALyx4SNAukjvCjloAhA6ugGAqjJkMFTIvL2MBWsusIV5ydUnz3ImU5g/NipL7ndar8C z+hRlZazAQ9r/iLs/gFNi5Y16jFfTBP/fffahtK51vovEMi1cfk8p76BY6JRCXuIVX+R1i Xek0WR3FXmXIJmdyRtaaltFaeeT4SCiewJRPigl5DnbecZcb5OATs99ryKAjRNojuyJojW BOLDGQpHU9JsE4loAoDbMdfTNPAI+iggq4dNUMoh/ZKQ8Zo1+4Dm/yB+jCuEAeRoVLJtWH ZxZJhZEgqVzEklK2BWqoyM+P1Nutrt1NUG4KTUEWsiYW+gKzGqk3xfiet1W7VA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=NEMkl1iN; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1711751867; 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: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=BPAtLDlT6O6HtpAN7ZdQykxF218bIztLRODPqy8zAKs=; b=lSGTFiEahQkovh4xPYK+besXk93knew3HlPMyZRVjr/Iu3bHs7j7XpyPObLua+C8tntr/d HwTT450quC3Cu+Dpz/jWdU8CRZXXDAaMiLPGJhjffb0IxxMJQZfzt1KKLuyvqb/za4i02A aGS841T9wvJXdEwrwoAy/b8BwAV4WXrDHWGHX6xApugBTCHTlnGjLnwNWVGaz4AYQuI0b9 QU64/WJARc4QayiIl9lM3Wj4Viwumn7FX55hmD99Ri6uHLLc+GvXyNf9NTJdtahjc2GNU5 6O7EnV1UnAdJVx9UbgBoPGOnmj+LlMltSTR6elvVNh7SJMkEtJP/1ZQjDUExhg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 41918324C5 for ; Fri, 29 Mar 2024 23:37:46 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqKqP-0006Ke-Ld; Fri, 29 Mar 2024 18:37:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqKqO-0006KM-I9 for guix-patches@gnu.org; Fri, 29 Mar 2024 18:37:04 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rqKqN-0004Oj-8H for guix-patches@gnu.org; Fri, 29 Mar 2024 18:37:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rqKqO-0007FM-3L for guix-patches@gnu.org; Fri, 29 Mar 2024 18:37:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69513] [PATCH] services: Add restic-backup service. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 29 Mar 2024 22:37:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69513 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Giacomo Leidi Cc: 69513@debbugs.gnu.org Received: via spool by 69513-submit@debbugs.gnu.org id=B69513.171175180227769 (code B ref 69513); Fri, 29 Mar 2024 22:37:03 +0000 Received: (at 69513) by debbugs.gnu.org; 29 Mar 2024 22:36:42 +0000 Received: from localhost ([127.0.0.1]:43601 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqKq0-0007DV-QT for submit@debbugs.gnu.org; Fri, 29 Mar 2024 18:36:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39090) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqKpy-0007DH-TT for 69513@debbugs.gnu.org; Fri, 29 Mar 2024 18:36:39 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqKpq-0004Ja-Lf; Fri, 29 Mar 2024 18:36:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=BPAtLDlT6O6HtpAN7ZdQykxF218bIztLRODPqy8zAKs=; b=NEMkl1iNkXXxkeOKpSRc W+k0pczyoha4tGDQCfzXXlZ6K8PUSiDQN3pn7ZOxyTTtyti9ZPyeBAFWxJZCdU7vjgRVlYhejRlwp f68oXctDDb1xkd+skwAoz5RwqhMPjzANM56XnI6+BWP0BhtXLDqHCWV8v5ZjNM4UUAcZH1iyNvl28 ZQyr0dlNbcAdezJsbVLwzbIMUTjYBwMKTbaDps018Yh7jB0rOEFH1YzWU2pKcYzneaqc4y00pej5V k2WoFT09P+JMuDEKd6KUpeljxnKueDAx/TZ504rsqfXvLnHe6scxRpaumyrdFXLm5Orlb9Y9sG9a2 +3pq9WOJxvUkuA==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <3afc07b0f3e6663a9fb64203544bce1659f97364.1709412684.git.goodoldpaul@autistici.org> (Giacomo Leidi's message of "Sat, 2 Mar 2024 21:51:24 +0100") References: <3afc07b0f3e6663a9fb64203544bce1659f97364.1709412684.git.goodoldpaul@autistici.org> Date: Fri, 29 Mar 2024 23:36:27 +0100 Message-ID: <87il14fyxg.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: -7.05 X-Migadu-Queue-Id: 41918324C5 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -7.05 X-TUID: 10+73xbh+0XP Hi, Giacomo Leidi skribis: > * gnu/services/backup.scm: New file. > * gnu/local.mk: Add this. > * doc/guix.texi: Document this. > > Change-Id: I9efd5559bb445b484107a7c27c2d0a65ccad1e66 [...] > +@subsubheading Backup services Please capitalize headings: =E2=80=9CBackup Services=E2=80=9D. We should probably move documentation of =E2=80=98syncthing-service-type=E2= =80=99 here, even if they live in different modules for now. > +The @code{(gnu services backup)} module offers services for backing up > +file system trees. For now, it provides the @code{restic-backup-service-= type}. ^ Nitpick: Please leave two spaces after an end-of-sentence period (for easier Emacs navigation, readability, and consistency). > +To backup a list of file system trees to a pre-initialized, end-to-end > +encrypted, deduplicated data repository, you could so with the > +@code{restic-backup-service-type}. For example with the following > +configuration: How about: With @code{restic-backup-service-type}, you can periodically back up directories and files with @uref{https://restic.net/, Restic}, which supports end-to-end encryption and deduplication. Consider the following configuration: ? > +Each @code{restic-backup-job} translates to an mcron job which sets the > +@code{RESTIC_PASSWORD} environment variable by reading the first line of @env{RESTIC_PASSWORD} > +@item @code{specification} (type: gexp-or-string) > +A string or a gexp that will be passed as time specification in the > +mcron job specification (@pxref{Syntax, mcron job specifications,, > +mcron,GNU@tie{}mcron}). Maybe =E2=80=98schedule=E2=80=99 rather than =E2=80=98specification=E2=80= =99, to clarify what=E2=80=99s being specified? (That=E2=80=99s the name I chose in .) > +@item @code{included} (default: @code{'()}) (type: list-of-lowerables) > +A list of values that are lowered to strings representing filesystem > +paths. These are the paths that will be recursively included in the > +current job. In GNU and Guix, =E2=80=9Cpath=E2=80=9D is used to denote =E2=80=9Csearch p= aths=E2=80=9D; in other cases, we write =E2=80=9Cfile name=E2=80=9D or =E2=80=9Cfile=E2=80=9D. So = I=E2=80=99d suggest something like: The list of files or directories to be backed up. The =E2=80=98files-to-backup=E2=80=99 (or =E2=80=98files=E2=80=99?) may be = more descriptive that =E2=80=98included=E2=80=99. > + (password-file > + (string) > + "The path of a password file, readable by the configured @code{user},= that =E2=80=9CName of the password file=E2=80=9D > +will be used to set the @code{RESTIC_PASSWORD} environment variable for = the s/@code/@env/ > + (program-file > + "restic-backup-job.scm" > + (with-imported-modules (source-module-closure > + '((guix build utils))) > + #~(begin > + (use-modules (guix build utils) > + (ice-9 popen) > + (ice-9 rdelim)) > + (setenv "RESTIC_PASSWORD" > + (with-input-from-file #$password-file read-line)) > + > + (execlp #$restic #$@verbose > + "-r" #$repository > + #$@extra-flags > + "backup" #$@included)))))) I believe (guix build utils) is unused, in which case you can remove it. The =E2=80=98execlp=E2=80=99 call lacks argv[0]; it should look like this: (execlp #$restic #$restic #$@verbose "-r" =E2=80=A6) (Notice that #$restic appears twice.) Could you send an updated patch? Thanks, Ludo=E2=80=99.