vanadium: setup systemd backup service

This commit is contained in:
Primrose 2025-01-31 15:55:19 +01:00
parent 60b130a65d
commit 72bcb6d137
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
4 changed files with 68 additions and 14 deletions

View file

@ -63,6 +63,7 @@
restic_backblaze_env.file = ../../../secrets/restic_backblaze_env.age;
seagate_pwd.file = ../../../secrets/seagate_pwd.age;
restic_seagate_pwd.file = ../../../secrets/restic_seagate_pwd.age;
};
services.fwupd.enable = true;

View file

@ -1,21 +1,55 @@
{ config, ... }:
{
services.restic.backups."Documents-backblaze" = {
paths = [
"/home/leana/Documents"
"/home/leana/Calibre"
];
passwordFile = config.age.secrets.restic_backblaze_pwd.path;
repositoryFile = config.age.secrets.restic_backblaze_repo.path;
environmentFile = config.age.secrets.restic_backblaze_env.path;
services.restic.backups = {
"Documents-backblaze" = {
paths = [
"/home/leana/Documents"
"/home/leana/Calibre"
];
passwordFile = config.age.secrets.restic_backblaze_pwd.path;
repositoryFile = config.age.secrets.restic_backblaze_repo.path;
environmentFile = config.age.secrets.restic_backblaze_env.path;
pruneOpts = [
"--keep-daily 7"
"--keep-weekly 4"
"--keep-monthly 12"
"--keep-yearly 10"
];
};
"Music-seagate" = {
paths = [
"/home/leana/Music"
];
repository = "/mnt/seagate/restic";
passwordFile = config.age.secrets.restic_seagate_pwd.path;
timerConfig = {
onCalendar = "02:00";
};
pruneOpts = [
"--keep-daily 7"
"--keep-weekly 4"
"--keep-monthly 12"
"--keep-yearly 10"
];
};
pruneOpts = [
"--keep-daily 7"
"--keep-weekly 4"
"--keep-monthly 12"
"--keep-yearly 10"
];
};
systemd.services."restic-backups-Music-seagate" = {
requires = [ "mnt-seagate.mount" ];
after = [ "mnt-seagate.mount" ];
unitConfig = {
PropagatesStopTo = [ "mnt-seagate.mount" ];
};
};
}