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
(match-record-lambda <downloads-garbage-collector-configuration>
(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
(documentation "Garbage collect downloaded files more than 1 week old for USER.")
(provision '(downloads-garbage-collector))
;(requirement '(root))
(modules '((shepherd service timer)))
(start #~(make-timer-constructor
(calendar-event #:hours '(8) #:minutes '(20)
#:days-of-week '(tuesday))
(calendar-event #:hours '(19) #:minutes '(50)
#:days-of-week '(monday))
(command #$cleanup-command)))
(stop #~(make-timer-destructor))
(actions (list (shepherd-action