diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2017-12-17 01:06:14 +0100 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2017-12-17 01:06:14 +0100 |
| commit | 0a2be7dd885f81749b195e438e0b9ae240fd937a (patch) | |
| tree | 309a37f85d141d3f6542ec5c692b081d4d696093 | |
| parent | cfc835ef40bc78235fe4719a8389a7ce8a7d1882 (diff) | |
| download | nixos-0a2be7dd885f81749b195e438e0b9ae240fd937a.tar nixos-0a2be7dd885f81749b195e438e0b9ae240fd937a.tar.gz nixos-0a2be7dd885f81749b195e438e0b9ae240fd937a.tar.bz2 nixos-0a2be7dd885f81749b195e438e0b9ae240fd937a.tar.xz nixos-0a2be7dd885f81749b195e438e0b9ae240fd937a.zip | |
borg?
| -rw-r--r-- | hel.nix | 28 |
1 files changed, 28 insertions, 0 deletions
| @@ -518,5 +518,33 @@ | |||
| 518 | systemd.services."NetworkManager-wait-online".enable = true; | 518 | systemd.services."NetworkManager-wait-online".enable = true; |
| 519 | 519 | ||
| 520 | services.btrfs-snapshots.enable = true; | 520 | services.btrfs-snapshots.enable = true; |
| 521 | |||
| 522 | systemd.services."backup-odin@" = { | ||
| 523 | enable = true; | ||
| 524 | |||
| 525 | BindsTo = [ "btrfs-snapshots@%i.service" ]; | ||
| 526 | After = [ "btrfs-snapshots@%i.service" ]; | ||
| 527 | |||
| 528 | path = with pkgs; [borgbackup]; | ||
| 529 | |||
| 530 | script = '' | ||
| 531 | borg create \ | ||
| 532 | --stats \ | ||
| 533 | --list \ | ||
| 534 | --filter 'AME' \ | ||
| 535 | --exclude-caches \ | ||
| 536 | --keep-exclude-tags \ | ||
| 537 | --patterns-from .backup \ | ||
| 538 | --one-file-system \ | ||
| 539 | --compression auto,lzma \ | ||
| 540 | --dry-run \ | ||
| 541 | borg.odin:/srv/backup/borg::yggdrasil.midgard.hel.$1-{utcnow} | ||
| 542 | ''; | ||
| 543 | scriptArgs = [ "%i" ]; | ||
| 544 | |||
| 545 | serviceConfig = { | ||
| 546 | WorkingDirectory = "/mnt/snapshot-%i"; | ||
| 547 | }; | ||
| 548 | }; | ||
| 521 | } | 549 | } |
| 522 | 550 | ||
