This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-30
Channels
- # announcements (1)
- # babashka (15)
- # calva (3)
- # cider (1)
- # clj-kondo (16)
- # clj-on-windows (1)
- # cljfx (1)
- # clojure (25)
- # clojure-europe (6)
- # clojure-spec (15)
- # cursive (13)
- # emacs (11)
- # fulcro (2)
- # humbleui (7)
- # introduce-yourself (1)
- # jackdaw (1)
- # off-topic (10)
- # pathom (5)
- # portal (3)
- # re-frame (7)
- # reagent (12)
- # releases (1)
- # shadow-cljs (8)
- # tools-build (18)
- # web-security (10)
I'm running a script with bb via cron, but not seeing any output. Neither in system logs (`journalctl -f`), nor when redirecting output to a file (`bb script.clj &> script.log`). Also not for println
s, nor when logging with clojure.tools.logging
or timbre. Any ideas why this is?
All combinations work as expected when running the script in the same way from a terminal
Why would running bb from a bash script behave differently than when it's executed by cron?
ehm, well, I actually meant executing a bash script that did that echo, but glad it works, I have no idea why this works ;)
@UJY23QLS1 cron runs in a different environment to ordinary bash, so if you want to rely on bb for cron tasks it is probably worth investigating how your crontab's environment differs (e.g. a different $PATH) from your standard bash environment. https://stackoverflow.com/questions/29103763/ubuntu-cron-shebang-not-working
Yeah, my best guess at an explanation is along those lines: somehow stdout/stderr isn't set up and inherited by cron jobs in the same way as they are in bash. Something else that crossed my mind is that it could be Java that does some similar stdout/stderr voodoo (which I vaguely recall having bumped into before), and that bb inherited those oddities from there. Unfortunately I don't have the bandwidth to investigate further.