mirror of
https://git.in.rschanz.org/ryan77627/guix-config.git
synced 2025-02-25 18:29:49 -05:00
just gonna use -delete
This commit is contained in:
parent
51bdc7674c
commit
bd9bdb7ba6
1 changed files with 4 additions and 4 deletions
|
@ -38,22 +38,22 @@
|
|||
(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" "-delete")))
|
||||
(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 '(19) #:minutes '(50)
|
||||
#:days-of-week '(monday))
|
||||
(calendar-event #:hours '(08) #:minutes '(30)
|
||||
#:days-of-week '(tuesday))
|
||||
(command #$cleanup-command)))
|
||||
(stop #~(make-timer-destructor))
|
||||
(actions (list (shepherd-action
|
||||
(name 'trigger)
|
||||
(documentation "Trigger GC in Downloads folder for USER")
|
||||
(procedure #~(lambda _
|
||||
(system (string-join #$cleanup-command " ")))))))))))
|
||||
(apply system* #$cleanup-command))))))))))
|
||||
|
||||
(define-public downloads-garbage-collector-service-type
|
||||
(service-type
|
||||
|
|
Loading…
Reference in a new issue