From: "Ludovic Courtès" <ludo@gnu.org>
To: Giacomo Leidi <goodoldpaul@autistici.org>
Cc: 69513@debbugs.gnu.org
Subject: [bug#69513] [PATCH] services: Add restic-backup service.
Date: Fri, 29 Mar 2024 23:36:27 +0100 [thread overview]
Message-ID: <87il14fyxg.fsf@gnu.org> (raw)
In-Reply-To: <3afc07b0f3e6663a9fb64203544bce1659f97364.1709412684.git.goodoldpaul@autistici.org> (Giacomo Leidi's message of "Sat, 2 Mar 2024 21:51:24 +0100")
Hi,
Giacomo Leidi <goodoldpaul@autistici.org> 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: “Backup Services”.
We should probably move documentation of ‘syncthing-service-type’ 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 ‘schedule’ rather than ‘specification’, to clarify what’s being
specified? (That’s the name I chose in <unattended-upgrade-configuration>.)
> +@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, “path” is used to denote “search paths”; in other
cases, we write “file name” or “file”. So I’d suggest something like:
The list of files or directories to be backed up.
The ‘files-to-backup’ (or ‘files’?) may be more descriptive that
‘included’.
> + (password-file
> + (string)
> + "The path of a password file, readable by the configured @code{user}, that
“Name of the password file”
> +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 ‘execlp’ call lacks argv[0]; it should look like this:
(execlp #$restic #$restic #$@verbose "-r" …)
(Notice that #$restic appears twice.)
Could you send an updated patch?
Thanks,
Ludo’.
next prev parent reply other threads:[~2024-03-29 22:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-02 20:51 [bug#69513] [PATCH] services: Add restic-backup service Giacomo Leidi via Guix-patches via
2024-03-29 22:36 ` Ludovic Courtès [this message]
2024-04-02 20:33 ` paul via Guix-patches via
2024-05-01 21:14 ` paul via Guix-patches via
2024-04-02 20:34 ` [bug#69513] [PATCH v2] " Giacomo Leidi via Guix-patches via
2024-05-01 21:15 ` [bug#69513] [PATCH v3] " Giacomo Leidi via Guix-patches via
2024-05-25 13:23 ` bug#69513: " Ludovic Courtès
2024-05-30 19:23 ` [bug#69513] Adding a couple new features and tests Richard Sent
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87il14fyxg.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=69513@debbugs.gnu.org \
--cc=goodoldpaul@autistici.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).