Fixed download folder manager service

This commit is contained in:
Ryan 2025-02-24 19:50:21 -05:00
parent ba2e2d7b10
commit 51bdc7674c
Signed by: ryan77627
GPG key ID: 81B0E222A3E2308E

View file

@ -38,15 +38,15 @@
(define downloads-garbage-collector-service (define downloads-garbage-collector-service
(match-record-lambda <downloads-garbage-collector-configuration> (match-record-lambda <downloads-garbage-collector-configuration>
(user) (user)
(let ((cleanup-command #~(list "find" (string-append "/home/" #$user "/Downloads") "-mtime" "+7" "-exec" "rm" "-rf" "{}" "';'"))) (let ((cleanup-command #~(list "find" (string-append "/home/" #$user "/Downloads") "-mtime" "+7" "-exec" "rm" "-rf" "'{}'" ";")))
(shepherd-service (shepherd-service
(documentation "Garbage collect downloaded files more than 1 week old for USER.") (documentation "Garbage collect downloaded files more than 1 week old for USER.")
(provision '(downloads-garbage-collector)) (provision '(downloads-garbage-collector))
;(requirement '(root)) ;(requirement '(root))
(modules '((shepherd service timer))) (modules '((shepherd service timer)))
(start #~(make-timer-constructor (start #~(make-timer-constructor
(calendar-event #:hours '(8) #:minutes '(20) (calendar-event #:hours '(19) #:minutes '(50)
#:days-of-week '(tuesday)) #:days-of-week '(monday))
(command #$cleanup-command))) (command #$cleanup-command)))
(stop #~(make-timer-destructor)) (stop #~(make-timer-destructor))
(actions (list (shepherd-action (actions (list (shepherd-action