GNU bug report logs - #75045
[PATCH] services: restic-backup: Implement as a Shepherd timer.

Previous Next

Package: guix-patches;

Reported by: Giacomo Leidi <goodoldpaul <at> autistici.org>

Date: Mon, 23 Dec 2024 10:47:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 75045 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Giacomo Leidi <goodoldpaul <at> autistici.org>
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>, 75045 <at> debbugs.gnu.org
Subject: Re: [bug#75045] [PATCH] services: restic-backup: Implement as a
 Shepherd timer.
Date: Tue, 24 Dec 2024 11:40:19 +0100
Hi Giacomo,

Giacomo Leidi <goodoldpaul <at> 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.





This bug report was last modified 113 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.