nixos/colony: Backup LVM metadata

This commit is contained in:
2023-11-12 19:30:06 +01:00
parent 14f1f5b575
commit 02eb96fe46
2 changed files with 29 additions and 0 deletions

View File

@@ -138,6 +138,23 @@ in
"serial-getty@ttyS0".enable = true;
"serial-getty@ttyS1".enable = true;
rsync-lvm-meta = {
description = "rsync lvm metadata backups / archives to rsync.net";
serviceConfig = {
Type = "oneshot";
# Only run when no other process is using CPU or disk
CPUSchedulingPolicy = "idle";
IOSchedulingClass = "idle";
};
script = ''
${pkgs.rsync}/bin/rsync -av --delete --delete-after \
-e "${pkgs.openssh}/bin/ssh -i ${config.age.secrets."colony/rsync.key".path}" \
/etc/lvm/{archive,backup} zh2855@zh2855.rsync.net:colony/lvm/
'';
wantedBy = [ "borgthin-job-main.service" ];
after = [ "borgthin-job-main.service" ];
};
borgthin-rsync = {
description = "rsync borgthin backups to rsync.net";
serviceConfig = {