You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
602 B
Scheme

(import chicken scheme)
(use posix srfi-19)
(define (log* msg)
(display (conc "[" (date->string (current-date) "~D ~T") "] " msg "\n")
(current-error-port)))
(let ((cmd "./feeds"))
(let loop ()
(log* "running")
(let loop2 ((pid (process-run cmd)))
(sleep 300) ; 5 minutes
(when (= (process-wait pid #t) 0)
(log* "killing")
(process-signal pid signal/kill)
(log* "sent kill sigal")
(process-wait pid)
(log* "killed and rerunning")
(loop2 (process-run cmd))))
(log* "done")
(sleep 540) ; 9 minutes
(loop)))