From ce80e63e1af034f5493d255fb03e2b16eeeb6b91 Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Sat, 20 May 2023 15:56:05 +0200 Subject: Clean up phone backups --- tw/system/vin.scm | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'tw/system') diff --git a/tw/system/vin.scm b/tw/system/vin.scm index 3076fd8f..41842b4e 100644 --- a/tw/system/vin.scm +++ b/tw/system/vin.scm @@ -56,11 +56,47 @@ (service restic-cleanup-service-type (list (restic-cleanup-repository ;; Laptop backups run at "0 */2 * * *". - (schedule #~"10 5 * * *") ; daily at 05:10 + (schedule #~"0 5 * * *") (url "/var/backups/restic/timo/laptop") (password-file "/etc/restic/timo-laptop") (keep-within "14d") (keep-weekly 52) + (keep-monthly -1)) + + ;; Phone backups run with a new version of restic, which creates + ;; v2 repos by default. Guix' older restic version can't read + ;; 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") + (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 7)) + + (restic-cleanup-repository + (schedule #~"0 4 * * *") + (url "/var/backups/restic/timo/phone") + (password-file "/etc/restic/timo-phone") + (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 9 * * *") + (url "/var/backups/restic/timo/phone") + (password-file "/etc/restic/timo-phone") + (snapshot-paths '("/storage/FF37-F8E6/OAndBackupX")) + (keep-daily 14) (keep-monthly -1)))) (server-base-services host-name))) -- cgit v1.2.3