(use-modules (ice-9 match)) (define mbsync (make #:provides '(mbsync offlineimap) #:docstring "Sync mail to the local system" #:start (lambda args (match (primitive-fork) (0 (begin (while #t (system* "mbsync" "-a") ;; Random time between 45 and 60 seconds (sleep (+ 45 (random 15)))))) (pid pid))) #:stop (make-kill-destructor) #:respawn? #t)) (register-services mbsync) (start mbsync)