summaryrefslogtreecommitdiff
path: root/tw/system/vin.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tw/system/vin.scm')
-rw-r--r--tw/system/vin.scm64
1 files changed, 41 insertions, 23 deletions
diff --git a/tw/system/vin.scm b/tw/system/vin.scm
index 6a773a58..d05a493b 100644
--- a/tw/system/vin.scm
+++ b/tw/system/vin.scm
@@ -66,19 +66,27 @@
(prometheus-auth? #f)))
(service restic-cleanup-service-type
- (list (restic-cleanup-repository
+ (list (restic-scheduled-cleanup
;; Laptop backups run at "0 */2 * * *".
(schedule #~"0 5 * * *")
- (url "/var/backups/restic/timo/laptop")
- (password-file "/etc/restic/timo-laptop")
+ (repo (restic-local-repository
+ (path "/var/backups/restic/timo/laptop")))
+ (password (restic-password-source
+ (type 'file)
+ (name "/etc/restic/timo-laptop")))
+ (user "restic")
(keep-within "14d")
(keep-weekly 52)
(keep-monthly -1))
- (restic-cleanup-repository
+ (restic-scheduled-cleanup
(schedule #~"0 5 * * *")
- (url "/var/backups/restic/timo/sync")
- (password-file "/etc/restic/timo-sync")
+ (repo (restic-local-repository
+ (path "/var/backups/restic/timo/sync")))
+ (password (restic-password-source
+ (type 'file)
+ (name "/etc/restic/timo-sync")))
+ (user "restic")
(keep-within "14d")
(keep-weekly 52)
(keep-monthly -1))
@@ -88,33 +96,43 @@
;; these, so create the repo on the server before pushing to it.
;; Restic doesn't automatically upgrade the repo version.
;;
- ;; Phone backups run "hourly" (modulo Android's throttling of
- ;; the Restic app), but the underlying data changes at most once
- ;; a day, so use `keep-daily' instead of `keep-within'.
-
- (restic-cleanup-repository
- (schedule #~"0 3 * * *")
- (url "/var/backups/restic/timo/phone")
- (password-file "/etc/restic/timo-phone")
+ ;; Phone backups run "daily" (modulo Android's throttling of
+ ;; the Restic app; usually between midnight and 2am), so use
+ ;; `keep-daily' instead of `keep-within' to discard duplicates.
+
+ (restic-scheduled-cleanup
+ (schedule #~"0 4 * * *")
+ (repo (restic-local-repository
+ (path "/var/backups/restic/timo/phone")))
+ (password (restic-password-source
+ (type 'file)
+ (name "/etc/restic/timo-phone")))
+ (user "restic")
(snapshot-paths '("/storage/FF37-F8E6/SignalBackup"))
;; We only really care about the last signal backup, but guard
;; against accidental deletion by keeping more.
(keep-daily 3))
- (restic-cleanup-repository
+ (restic-scheduled-cleanup
(schedule #~"0 4 * * *")
- (url "/var/backups/restic/timo/phone")
- (password-file "/etc/restic/timo-phone")
+ (repo (restic-local-repository
+ (path "/var/backups/restic/timo/phone")))
+ (password (restic-password-source
+ (type 'file)
+ (name "/etc/restic/timo-phone")))
+ (user "restic")
(snapshot-paths '("/storage/emulated/0/Backups"))
(keep-daily 14)
(keep-monthly -1))
- (restic-cleanup-repository
- ;; OAndBackupX/NeoBackup backups can run until the early-ish
- ;; morning; cleanup once they're all done and pushed.
- (schedule #~"0 11 * * *")
- (url "/var/backups/restic/timo/phone")
- (password-file "/etc/restic/timo-phone")
+ (restic-scheduled-cleanup
+ (schedule #~"0 4 * * *")
+ (repo (restic-local-repository
+ (path "/var/backups/restic/timo/phone")))
+ (password (restic-password-source
+ (type 'file)
+ (name "/etc/restic/timo-phone")))
+ (user "restic")
(snapshot-paths '("/storage/FF37-F8E6/OAndBackupX"))
(keep-daily 14)
(keep-monthly -1))))