542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
|
(if (not (alist-ref 'cron val-alist)) ;; gotta have cron spec
(print "ERROR: bad sense spec \"" (string-intersperse sense " ") "\" params: " val-alist)
(let* ((run-name (alist-ref 'run-name val-alist))
(target (alist-ref 'target val-alist))
(crontab (alist-ref 'cron val-alist))
;; (action (alist-ref 'action val-alist))
(need-run (common:extended-cron crontab #f last-run))
(cron-safe-string (string-intersperse (string-split (alist-ref 'cron val-alist)) "-"))
(runname std-runname)) ;; (conc "sched" (time->string (seconds->local-time (current-seconds)) "%M%H%d")))))
(print "last-run: " last-run " need-run: " need-run)
(if need-run
(case (string->symbol action)
((sync)
(push-run-spec torun contour runkey
`((message . ,(conc ruletype ":sync-" cron-safe-string))
|
|
|
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
|
(if (not (alist-ref 'cron val-alist)) ;; gotta have cron spec
(print "ERROR: bad sense spec \"" (string-intersperse sense " ") "\" params: " val-alist)
(let* ((run-name (alist-ref 'run-name val-alist))
(target (alist-ref 'target val-alist))
(crontab (alist-ref 'cron val-alist))
;; (action (alist-ref 'action val-alist))
(need-run (common:extended-cron crontab #f last-run))
(cron-safe-string (string-translate (string-intersperse (string-split (alist-ref 'cron val-alist)) "-") "*" "X"))
(runname std-runname)) ;; (conc "sched" (time->string (seconds->local-time (current-seconds)) "%M%H%d")))))
(print "last-run: " last-run " need-run: " need-run)
(if need-run
(case (string->symbol action)
((sync)
(push-run-spec torun contour runkey
`((message . ,(conc ruletype ":sync-" cron-safe-string))
|