summaryrefslogtreecommitdiff
path: root/tw/services
diff options
context:
space:
mode:
authorTimo Wilken2023-05-20 13:32:32 +0200
committerTimo Wilken2023-05-20 13:32:32 +0200
commit3c2ee5e5383e4deac893489b4920297f4a4cb7b6 (patch)
tree793b612ba1641096bd702022492688564961a0ad /tw/services
parentb5f4f409326a63fd868d94c441ee9ace8cc748e7 (diff)
Rename `restic-backup-repository' to allow for cleanup repos
Diffstat (limited to 'tw/services')
-rw-r--r--tw/services/restic.scm26
1 files changed, 13 insertions, 13 deletions
diff --git a/tw/services/restic.scm b/tw/services/restic.scm
index d088e8ba..18c501a9 100644
--- a/tw/services/restic.scm
+++ b/tw/services/restic.scm
@@ -14,8 +14,7 @@
#:export (restic-server-service-type
restic-server-configuration
home-restic-backup-service-type
- home-restic-backup-configuration
- restic-repository))
+ restic-backup-repository))
(define-public %restic-user "restic")
(define-public %restic-group "restic")
@@ -129,10 +128,11 @@ private restic repos.")
(define (nonempty-list-of-strings? thing)
(and (pair? thing) (list-of-strings? thing)))
-(define-configuration/no-serialization restic-repository
+(define-configuration/no-serialization restic-backup-repository
(schedule gexp "An mcron schedule, specified as a gexp
-(@pxref{G-Expressions}). String, list or lambda syntax is fine
-(@pxref{Syntax, mcron job specifications,, mcron, GNU@tie{}mcron}).")
+(@pxref{G-Expressions}), to use for the backup job. String, list or lambda
+syntax is fine (@pxref{Syntax, mcron job specifications,, mcron,
+GNU@tie{}mcron}).")
(paths nonempty-list-of-strings "List of paths to back up. At least one
must be given. Leading @code{~/} are replaced with @code{$HOME}.")
(url-command string "Run this command (inside @code{sh -c}) to obtain the
@@ -144,7 +144,7 @@ passwords in @code{rest:} URLs.")
(define (restic-backup-cronjobs repositories)
(define (cronjob repo)
- #~(job #$(restic-repository-schedule repo)
+ #~(job #$(restic-backup-repository-schedule repo)
#$(program-file
"restic-backup-command"
#~(begin
@@ -156,15 +156,15 @@ passwords in @code{rest:} URLs.")
(string-replace path (getenv "HOME") 0 1)
path))
(setenv "RESTIC_PASSWORD_COMMAND"
- '#$(restic-repository-password-command repo))
- (let ((pipe (open-pipe '#$(restic-repository-url-command repo) OPEN_READ)))
+ '#$(restic-backup-repository-password-command repo))
+ (let ((pipe (open-pipe '#$(restic-backup-repository-url-command repo) OPEN_READ)))
(setenv "RESTIC_REPOSITORY" (string-trim-right (get-string-all pipe) #\newline))
(close-pipe pipe))
- (apply execl #$(file-append (restic-repository-restic repo) "/bin/restic")
- "restic" "backup"
+ (apply execl #$(file-append (restic-backup-repository-restic repo) "/bin/restic")
+ "restic" "backup" "--cleanup-cache"
#$@(append-map (lambda (tag) (list "--tag" tag))
- (restic-repository-tags repo))
- (map replace-home '#$(restic-repository-paths repo)))))))
+ (restic-backup-repository-tags repo))
+ (map replace-home '#$(restic-backup-repository-paths repo)))))))
(map cronjob repositories))
(define home-restic-backup-service-type
@@ -175,4 +175,4 @@ passwords in @code{rest:} URLs.")
(compose concatenate)
(extend append)
(default-value '())
- (description "Run scheduled backup jobs to the specified repos.")))
+ (description "Back up local directories on a schedule.")))