From: "Ludovic Courtès" <ludo@gnu.org>
To: Giacomo Leidi <goodoldpaul@autistici.org>
Cc: Maxim Cournoyer <maxim.cournoyer@gmail.com>, 75045@debbugs.gnu.org
Subject: [bug#75045] [PATCH] services: restic-backup: Implement as a Shepherd timer.
Date: Tue, 24 Dec 2024 11:40:19 +0100 [thread overview]
Message-ID: <87ikr95ppo.fsf@gnu.org> (raw)
In-Reply-To: <f52cde358b609d18f43bf62f1dfe63835c1a57b9.1734950765.git.goodoldpaul@autistici.org> (Giacomo Leidi's message of "Mon, 23 Dec 2024 11:46:05 +0100")
Hi Giacomo,
Giacomo Leidi <goodoldpaul@autistici.org> skribis:
> This patch implements restic backup with Shepherd services. It is
> supposed not to break any existing setup.
>
> * gnu/services/backup.scm (restic-backup-job): Add Shepherd
> configuration options;
> (restic-backup-job->mcron-job): Replace with...;
> (restic-job-log-file): New procedure;
> (restic-backup-job->shepherd-service): New procedure;
> (restic-backup-activation): New procedure;
> (restic-backup-service-type): Replace mcron with Shepherd extension and add
> activation extension hook.
> * doc/guix.texi: Document it.
>
> Change-Id: I66de3b6a1cb6177f9e4ee0c2acf3013ecbcdd338
Woo, nice!
As mentioned in <https://issues.guix.gnu.org/74860>, I think we should
postpone a little bit since these new features won’t work for people who
haven’t rebooted into Shepherd 1.0, and they’ll get possibly confusing
messages when reconfiguring.
How we should postpone, I’m not sure. The conservative approach would
be to wait until after the next Guix release, but that doesn’t sound
reasonable… One month after the Shepherd upgrade, which would be
Jan. 9th? It’s common for servers to have much longer uptimes though,
plus there’s end-of-year vacation here.
> + (log-file
> + (maybe-string)
> + "The file system path to the log file for this job. By default the file will
> +have the name of the job and be under @code{/var/log/restic-backup}.")
Rather @file, with the “.log” suffix too, if I’m not mistaken.
> + (max-duration
> + (maybe-number)
> + "The maximum duration in seconds that a job may last. Past
> +@code{max-duration} seconds, the job will forcefully terminated.")
s/will/is/
> + (shepherd-service (provision `(,(string->symbol
> + (string-append name "-job"))))
I would tend to not add the “-job” suffix, but that’s a matter of taste!
> + (command
> + (list
> + (string-append #+bash-minimal "/bin/bash")
> + "-l" "-c"
> + (string-append "restic-guix backup " #$name))
Why go through bash? Would it be possible to execute ‘restic-guix’
directly?
> (description
> - "This service configures @code{mcron} jobs for running backups
> + "This service configures @code{Shepherd} timers for running backups
> with @code{restic}.")))
You can drop @code here.
parent reply other threads:[~2024-12-24 10:43 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <f52cde358b609d18f43bf62f1dfe63835c1a57b9.1734950765.git.goodoldpaul@autistici.org>]
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=87ikr95ppo.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=75045@debbugs.gnu.org \
--cc=goodoldpaul@autistici.org \
--cc=maxim.cournoyer@gmail.com \
/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).