unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#75045] [PATCH] services: restic-backup: Implement as a Shepherd timer.
       [not found] <f52cde358b609d18f43bf62f1dfe63835c1a57b9.1734950765.git.goodoldpaul@autistici.org>
@ 2024-12-24 10:40 ` Ludovic Courtès
  0 siblings, 0 replies; only message in thread
From: Ludovic Courtès @ 2024-12-24 10:40 UTC (permalink / raw)
  To: Giacomo Leidi; +Cc: Maxim Cournoyer, 75045

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.





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-12-24 10:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <f52cde358b609d18f43bf62f1dfe63835c1a57b9.1734950765.git.goodoldpaul@autistici.org>
2024-12-24 10:40 ` [bug#75045] [PATCH] services: restic-backup: Implement as a Shepherd timer Ludovic Courtès

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).