From: EuAndreh <eu@euandre.org>
To: help-guix <Help-Guix@gnu.org>
Subject: How to call a local function from a mcron job?
Date: Sun, 29 Nov 2020 20:58:23 -0300 [thread overview]
Message-ID: <87czzvn2ao.fsf@euandre.org> (raw)
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?
next reply other threads:[~2020-11-30 0:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-29 23:58 EuAndreh [this message]
2020-12-20 22:19 ` How to call a local function from a mcron job? Joshua Branson
2020-12-22 23:44 ` EuAndreh 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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87czzvn2ao.fsf@euandre.org \
--to=eu@euandre.org \
--cc=Help-Guix@gnu.org \
/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.
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).