3 ms·
Another Guile component is mcron[1] which allows cron jobs to be scheduled using Lispy syntax as well. I have, for instance: ;; fetch mail via isync/mbsync f
by _emacsomancer_ 8y ago
Another Guile component is mcron[1] which allows cron jobs to be scheduled using Lispy syntax as well. I have, for instance:
;; fetch mail via isync/mbsync for mu/mu4e every 5 minutes
(job '(next-minute (range 0 60 5)) "/home/$USER/.guix-profile/bin/mbsync -a")
;; run backup every hour
(job '(next-hour (range 0 23 1)) "/home/$USER/.local/bin/borg-backup.sh")
[1]: https://www.gnu.org/software/mcron/manual/html_node/index.html#Top https://www.gnu.org/software/mcron/manual/html_node/index.ht...
- i_feel_great 8y agoIf you want to know why mcron as opposed to cron, you only need to look at the introduction: https://www.gnu.org/software/mcron/manual/html_node/Introduction.html#Introduction https://www.gnu.org/software/mcron/manual/html_node/Introduc...
- _emacsomancer_ 8y agoI still wish there were a few more examples of actual guile cron jobs, but there is one example which illustrates the power of using guile for defining cron jobs in the 'every second Sunday' example: (job (lambda (current-time) (let* ((next-month (next-month-from current-time)) (first-day (tm:wday (localtime next-month))) (second-sunday (if (eqv? first-day 0) 8 (- 14 first-day)))) (+ next-month (* 24 60 60 second-sunday)))) "my-program")