From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex ter Weele Subject: How can I use () Date: Sat, 13 Jan 2018 08:32:48 -0600 Message-ID: <87h8rp25in.fsf@librem.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eaUN9-00071w-M7 for help-guix@gnu.org; Sat, 13 Jan 2018 17:33:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eaUN5-0002sJ-Uv for help-guix@gnu.org; Sat, 13 Jan 2018 17:33:55 -0500 Received: from mail-it0-x231.google.com ([2607:f8b0:4001:c0b::231]:33911) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eaUN5-0002rw-Op for help-guix@gnu.org; Sat, 13 Jan 2018 17:33:51 -0500 Received: by mail-it0-x231.google.com with SMTP id m11so5039889iti.1 for ; Sat, 13 Jan 2018 14:33:51 -0800 (PST) Received: from librem (24-148-50-16.s5644.c3-0.mart-ubr1.chi-mart.il.cable.rcncustomer.com. [24.148.50.16]) by smtp.gmail.com with ESMTPSA id z102sm11260937ioi.86.2018.01.13.14.33.48 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 13 Jan 2018 14:33:48 -0800 (PST) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: help-guix@gnu.org (Following this conversion on #guix: https://gnunet.org/bot/log/guix/2018-01-10#T1600427) I am trying to use the mcron service to run backups. I have written: (define (backup-home user) #~(begin (execl (string-append #$borg "/bin/borg") "create" "--stats" "--list" "--verbose" "/mnt/borg::{hostname}-{utcnow}" (format "/home/%s" #$user)) ;; TODO: borg prune. )) (define (backup-home-job user) #~(job '(next-hour '(18)) #$(backup-home user) #:user #$user)) I would like to run the gexp (backup-home "alex") from the REPL so that I can verify it works properly. I looked into what the mcron service itself does with the gexp in order to run it and found that (gnu shepherd)'s shepherd-configuration-file uses gexp->file. Based on this, what I think I want to do is something like: ,enter-store-monad (build (list (gexp->script "test" (backup-home "alex")))) And then run the resulting script file. However, doing such gives the error: ERROR: In procedure string->utf8: ERROR: In procedure string->utf8: Wrong type argument in position 1 (expecting string): # At this point I tried putting a string in what I think is the right place, once again running in the store monad REPL: (build "foo" (list (gexp->script "test" (backup-home "alex")))) But this gives: ERROR: In procedure length: ERROR: In procedure length: Wrong type argument in position 1: "foo" At which point I'm stumped. I'd love to know what I'm doing wrong! Thanks, Alex