summaryrefslogtreecommitdiffstats
path: root/tv/2configs/backup.nix
blob: 51d3bb8a725486ae09e1de2a22329e1ce0a49fe7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{ config, lib, ... }:
with lib;
{
  krebs.backup.plans = addNames {
    xu-test-cd = {
      method = "push";

      src = { host = config.krebs.hosts.xu; path = "/tmp/xu-test"; };
      dst = { host = config.krebs.hosts.cd; path = "/tmp/backups/xu-test"; };

      #startAt = "0,6,12,18:00";
      startAt = "minutely";
      snapshots = {
        minutely = { format = "%Y-%m-%dT%H:%M"; retain =  5; };
        hourly   = { format = "%Y-%m-%dT%H";    retain =  4; };
        daily    = { format = "%Y-%m-%d";       retain =  7; };
        weekly   = { format = "%YW%W";          retain =  4; };
        monthly  = { format = "%Y-%m";          retain = 12; };
        yearly   = { format = "%Y";                          };
      };
    };
    #xu-test-wu = {
    #  method = "push";
    #  dst = { user = tv; host = wu; path = "/krebs/backup/xu-test"; };
    #};
    cd-test-xu = {
      method = "pull";
      src = { host = config.krebs.hosts.cd; path = "/tmp/cd-test"; };
      dst = { host = config.krebs.hosts.xu; path = "/tmp/backups/cd-test"; };
      startAt = "minutely";
      snapshots = {
        minutely = { format = "%Y-%m-%dT%H:%M"; retain =  5; };
        hourly   = { format = "%Y-%m-%dT%H";    retain =  4; };
        daily    = { format = "%Y-%m-%d";       retain =  7; };
        weekly   = { format = "%YW%W";          retain =  4; };
        monthly  = { format = "%Y-%m";          retain = 12; };
        yearly   = { format = "%Y";                          };
      };
    };

  };
}