From: paul via Guix-patches via <guix-patches@gnu.org>
To: Richard Sent <richard@freakingpenguin.com>
Cc: 71639@debbugs.gnu.org
Subject: [bug#71639] [PATCHv2 0/5] Improve on restic-backup-service
Date: Sun, 7 Jul 2024 22:40:55 +0200 [thread overview]
Message-ID: <18da4124-465c-fa58-6e8f-d9daf751443c@autistici.org> (raw)
In-Reply-To: <87ikxvvy0o.fsf@freakingpenguin.com>
[-- Attachment #1: Type: text/plain, Size: 2056 bytes --]
Hi Richard,
On 6/27/24 05:56, Richard Sent wrote:
> I'll take a look at it and see what the code looks like. It might be a
> bit of effort to get that working cleanly while avoiding code dupe. For
> instance, setting RESTIC_PASSWORD(_COMMAND) in both init and backup
> program actions.
Yes, 100% agree. What I would do is (and probably there is a better way):
- rename restic-backup-job-program to restic-action-job-program or
something similar. the procedure would be the same but it would take two
additional arguments: an action-name argument or similar that would
replace all instances of "backup" and I think this new procedure should
not access the files field of the job record but it instead it would
take an action-arguments argument which would replace #$@files with
#$@action-arguments in the execlp call. This way, I hope, it could be
general enough to support additional actions besides init in the future,
such as purge or restore.
- create a new restic-backup-job-program and a restic-init-job-program
or similar procedures that would call the new generic
restic-action-job-program
- inside the restic-guix procedure I'd rename the programs list to
backup-programs and I would create a similar list for the init action
with #f placeholders for jobs that do not require initializing, and I
would check the conditional inside the backup procedure something like:
(define (get-program name programs)
[...])
(define (init args)
[...])
(define (backup args)
(define name (third args))
(define backup-program (get-program name backup-programs))
(define init-program (get-program name init-programs))
(when init-program
(init args))
(execlp backup-program backup-program))
this requires the init action not to exec the script resulting from the
gexp but I can't think of a reason why it could be problematic right now
so I guess it is ok.
Please take all of the above as a proposal there are for sure things to
make better.
> Thanks for the feedback!
Thank you very much for your work,
giacomo
[-- Attachment #2: Type: text/html, Size: 2729 bytes --]
next prev parent reply other threads:[~2024-07-07 20:48 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-20 3:44 [bug#71660] [PATCH v2 0/5] Improve on restic-backup-service Richard Sent
2024-06-20 3:44 ` [bug#71661] [PATCH v2 1/5] services: backup: Support bootstrapping an initial restic backup Richard Sent
2024-06-20 3:44 ` [bug#71662] [PATCH v2 2/5] services: backup: Add password-command support to restic-service Richard Sent
2024-06-20 3:44 ` [bug#71663] [PATCH v2 3/5] services: backup: Add extra-packages field to restic-backup-job Richard Sent
2024-06-20 3:44 ` [bug#71639] [PATCH v2 4/5] services: backup: Move restic package to restic-configuration Richard Sent
2024-06-20 3:44 ` [bug#71665] [PATCH v2 5/5] tests: Add restic system test Richard Sent
2024-06-24 22:49 ` [bug#71639] [PATCHv2 0/5] Improve on restic-backup-service paul via Guix-patches via
2024-06-27 3:56 ` Richard Sent
2024-07-07 20:40 ` paul via Guix-patches via [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-06-18 22:06 [bug#71639] [PATCH WIP " Richard Sent
2024-06-18 22:08 ` [bug#71639] [PATCH WIP 1/5] services: backup: Support bootstrapping an initial restic backup Richard Sent
2024-06-18 22:08 ` [bug#71639] [PATCH WIP 2/5] services: backup: Add password-command support to restic-service Richard Sent
2024-06-18 22:08 ` [bug#71639] [PATCH WIP 3/5] services: backup: Add extra-packages field to restic-backup-job Richard Sent
2024-06-18 22:08 ` [bug#71639] [PATCH WIP 4/5] services: backup: Move restic package to restic-configuration Richard Sent
2024-06-18 22:08 ` [bug#71639] [PATCH WIP 5/5] tests: Add restic system test Richard Sent
2024-08-22 17:43 ` [bug#71639] [PATCHv2 0/5] Improve on restic-backup-service Fabio Natali via Guix-patches via
2024-08-25 14:12 ` paul via Guix-patches via
2024-09-03 16:43 ` [bug#71639] [PATCH WIP " Fabio Natali via Guix-patches via
2024-09-04 15:49 ` Richard Sent
2024-09-05 10:06 ` Fabio Natali via Guix-patches via
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=18da4124-465c-fa58-6e8f-d9daf751443c@autistici.org \
--to=guix-patches@gnu.org \
--cc=71639@debbugs.gnu.org \
--cc=goodoldpaul@autistici.org \
--cc=richard@freakingpenguin.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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.