* How to call a local function from a mcron job?
@ 2020-11-29 23:58 EuAndreh
2020-12-20 22:19 ` Joshua Branson
0 siblings, 1 reply; 3+ messages in thread
From: EuAndreh @ 2020-11-29 23:58 UTC (permalink / raw)
To: help-guix
Hi Guix!
I wrote a Guile function that works like a script that take no arguments
and interacts with the filesystem, something like:
(define (my-fn)
...)
It is a wrapper over other functions defined in the same file, and calls
them in the right order.
Then I wanted to make this function run as a mcron job, and I tried:
(define my-fn-job
#(job "* * * * *"
my-fn))
But that doesn't work. At reconfigure time, Guix complains about not
knowing the variable 'my-fn':
Unbound variable: my-fn
I tried wrapping it in a '(with-imported-modules ...)' call, but the
code isn't in a module, but in the same file.
I guess that putting all my code from 'my-fn' and all the functions it
calls inlined in a lambda in the job definition would solve it, but it
feels wrong to me.
Is there a way to reference it from the job, without embedding all the
scheme code in the job definition?
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-12-22 23:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-29 23:58 How to call a local function from a mcron job? EuAndreh
2020-12-20 22:19 ` Joshua Branson
2020-12-22 23:44 ` EuAndreh via
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).