diff --git a/operating-systems/buer/shepherd-services.scm b/operating-systems/buer/shepherd-services.scm index a31da28..bec1ece 100644 --- a/operating-systems/buer/shepherd-services.scm +++ b/operating-systems/buer/shepherd-services.scm @@ -43,11 +43,13 @@ next calendar event."))) #:hours '(8 14 20) #:minutes '(0)) (lambda () - (let ((btrfs "/run/current-system/profile/bin/btrfs") - (date (strftime "%Y-%m-%d" (localtime (current-time))))) - (spawn-shell-command - (string-append btrfs " subvolume snapshot" - " /home /snapshots/home/" date)))))) + (let* ((btrfs "/run/current-system/profile/bin/btrfs") + (date (strftime "%Y-%m-%d" (localtime (current-time)))) + (snapshot (string-append "/snapshots/home/" date))) + (unless (file-exists? snapshot) + (spawn-shell-command + (string-join + `(btrfs "subvolume snapshot /home" snapshot)))))))) (stop #~(make-timer-destructor)) (actions (list timer-trigger-action))))