Since we live in the era of Shepherd timers, I wanted to migrate to them from traditional cron jobs. For that I needed to get sending the job output via email working. Quick write up in case you need it as well: https://wolfsden.cz/blog/post/using-gnu-shepherd-timers-as-crons.html

#gnuguix #guix #gnushepherd #shepherd

Using GNU Shepherd timers as crons - Wolf's Den

Oh, and my blog now has syntax highlight.

@graywolf Woow, you found interesting bugs, thanks for reporting them!

Regarding the last point in your blog post, I’d suggest using the #:log-file option of ‘make-timer-constructor’ if that helps for you.

It is true that shepherd does not attempt to do mail, but I think it’s fine to do it at a higher level like you did (I’d suggesting using Mailutils though).

@civodul Thanks for the suggestions (and for reading it ^_^).

The thing is that I like having the output in a single file (/var/log/messages), less places to look into. I would just like it to be prefixed differently. Maybe #:log-file with a symbol (#:log-file 'outerr-1)? Or new #:log-label key? Hm, can I use #:log-file "/var/log/messages" or will things blow up?

I will look into Mailutils. I already have sendmail configured and working, so it seemed reasonable to just use it. :)

@graywolf Using #:log-file "/var/log/messages" would lead to two writers for that file, which wouldn’t be wise. :-)

But yeah, maybe we can make the prefix configurable or something.

@civodul Oh and I agree this does not necessarily belong into the Shepherd itself. I am fairly happy with the current solution.