init
This commit is contained in:
commit
3ab713a5b3
64 changed files with 2043 additions and 0 deletions
31
hosts/vessel/backup.nix
Normal file
31
hosts/vessel/backup.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
systemd.timers.local-backup = {
|
||||
description = "Local rsync Backup";
|
||||
wantedBy = ["timers.target"];
|
||||
timerConfig = {
|
||||
OnCalendar = "*-*-* 00:00:00";
|
||||
Persistent = true;
|
||||
Unit = "local-backup.service";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.local-backup = {
|
||||
description = "Local rsync Backup";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = ''${lib.getExe pkgs.rsync} --verbose --verbose --archive --update --delete /srv/storage/ /srv/backup/'';
|
||||
User = "root";
|
||||
Group = "root";
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/srv/backup" = {
|
||||
device = "/dev/disk/by-label/backup";
|
||||
fsType = "btrfs";
|
||||
options = ["subvol=main" "compress=zstd" "noatime"];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue