A simple tool that provides cron like facilities directly inside of common lisp. For this to work properly note that your lisp implementation should have support for threads
A simple tool that provides cron like facilities directly inside of common lisp.
a fork of https://bitbucket.org/mackram/cl-cron (unavailable)
Install with Quicklisp:
Note: Quicklisp does not point to this repository.
Print a message every minute.
(defun say-hi () (print "Hi!")) (cl-cron:make-cron-job #'say-hi) (cl-cron:start-cron)
Wait a minute to see output.
Stop all jobs with
(make-cron-job function-symbol &key (minute :every) (step-min 1) (hour :every) (step-hour 1) (day-of-month :every) (delete-cron-job cron-key) (time-to-run-job job) start-cron restart-cron stop-cron
(cl-cron:make-cron-job (lambda () (format t "Wake Up!~%")) ;; Days of week are numbered from 0, ;; where 0 is Monday. ;; Run every Sunday: :day-of-week 6 :hour 10 :minute 0 ;; hash-key is the name :hash-key :sunday-alarm) (cl-cron:delete-cron-job :sunday-alarm)
- 2020-10-13: we added a name to the cl-cron thread.