From f61d21d17df6d476c5353718c89664719e7a7626 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 8 Mar 2022 18:45:37 -0800 Subject: nas: backup photos and music Instead of rsync-ing these folders to a GCS bucket, I should instead do a backup. If I screw up something, the content will be sync-ed, and I won't be able to restore it. It's better (maybe more expensive, but that's OK) to keep snapshots and be able to restore. --- hosts/common/nas.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'hosts/common') diff --git a/hosts/common/nas.nix b/hosts/common/nas.nix index 2e1b6fc..f9017f2 100644 --- a/hosts/common/nas.nix +++ b/hosts/common/nas.nix @@ -17,4 +17,16 @@ group = "nas"; isSystemUser = true; }; + + services.restic.backups = { + media = { + paths = [ "/data/fast/music" "/data/fast/photos" ]; + repository = "/data/slow/backups/systems"; + passwordFile = config.age.secrets.restic-repo-systems.path; + timerConfig = { OnCalendar = "00:55"; }; + initialize = true; + extraBackupArgs = [ "--tag media" ]; + pruneOpts = [ "--keep-daily 7" "--keep-weekly 4" "--keep-monthly 12" ]; + }; + }; } -- cgit 1.4.1