diff --git a/.config/cron/job.guile b/.config/cron/job.guile index be8b297e..69e79a41 100644 --- a/.config/cron/job.guile +++ b/.config/cron/job.guile @@ -1,4 +1,4 @@ -;; -*- mode: Lisp; -*- +;; -*- mode: scheme; -*- ;; This cannot be let-bound within `job'. (define currency-file (string-append (getenv "HOME") "/.cache/currency.units")) @@ -6,7 +6,9 @@ (job (lambda (current-time) (let* ((seconds-in-a-day (* 60 60 24)) - (currency-time (stat:mtime (stat currency-file)))) + (currency-time (if (not (file-exists? currency-file)) + 0 + (stat:mtime (stat currency-file))))) (if (< currency-time (- current-time seconds-in-a-day)) ;; Use next-minute to avoid overwhelming the system in case of failure. (next-minute)