Index: common.scm
==================================================================
--- common.scm
+++ common.scm
@@ -345,11 +345,11 @@
                          (if (file-exists? file)
                              (- (current-seconds) (file-modification-time file))
                              1000000000))) ;; return really old value if file doesn't exist.  we want to clobber it if old or not exist.
              (ok-flag  #t)
              (age-mins (lambda (file) (/ (age-sec   file) 60)))
-             (age-hrs  (lambda (file) (/ (age-min s file) 60)))
+             (age-hrs  (lambda (file) (/ (age-mins file) 60)))
              (age-days (lambda (file) (/ (age-hrs   file) 24)))
              (age-wks  (lambda (file) (/ (age-days  file) 7)))
              (docmd    (lambda (cmd)
                          (cond
                           (ok-flag
@@ -397,11 +397,11 @@
 
 
         ;; if age(<file>.mins.gz) >= 1h:
         ;;     copy <file>.mins.gz <file>.hrs.gz
         ;;     copy <prev file> <file>.mins.gz
-        (when (>= (age-hrs minsfile) 1)
+        (when (>= (age-mins minsfile) 1)
           (copy minsfile hrsfile)
           (copy+zip filepath  minsfile))
         
         ;; if age(<file>.hrs.gz) >= 1d:
         ;;     copy <file>.hrs.gz <file>.days.gz
@@ -411,11 +411,11 @@
           (copy minsfile hrsfile))
         
         ;; if age(<file>.days.gz) >= 1w:
         ;;     copy <file>.days.gz <file>.weeks.gz
         ;;     copy <file>.hrs.gz <file>.days.gz
-        (when (>= (age-weeks daysfile) 1)
+        (when (>= (age-wks daysfile) 1)
           (copy daysfile wksfile)
           (copy hrsfile daysfile))
         #t)
       #f))
   

Index: server.scm
==================================================================
--- server.scm
+++ server.scm
@@ -503,11 +503,11 @@
 ;; moving this here as it needs access to db and cannot be in common.
 ;;
 (define (server:writable-watchdog dbstruct)
   (thread-sleep! 10) ;; delay for startup
   (let* ((legacy-sync  (common:run-sync?))
-         (sqlite-exe   (or (get-shell-env-var "MT_SQLITE3_EXE"))) ;; defined in cfg.sh
+         (sqlite-exe   (or (get-environment-variable "MT_SQLITE3_EXE"))) ;; defined in cfg.sh
          (sync-log     (or (args:get-arg "-sync-log") (conc *toppath* "/logs/sync-" (current-process-id) "-" (get-host-name) ".log")))
 	 (tmp-area     (common:get-db-tmp-area))
 	 (tmp-db       (conc tmp-area "/megatest.db"))
 	 (staging-file (conc *toppath* "/.megatest.db"))
 	 (mtdbfile     (conc *toppath* "/megatest.db"))