(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): #<procedure 327b030 at guix/gexp.scm:1128:2 (state)> 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