Browse Source

add support for Borg `--keep-minutely` prune option

Thomas LÉVEIL 11 months ago
parent
commit
24b5eccefc
3 changed files with 9 additions and 1 deletions
  1. 2
    0
      README.md
  2. 4
    0
      borgmatic/config/schema.yaml
  3. 3
    1
      borgmatic/tests/integration/config/test_validate.py

+ 2
- 0
README.md View File

@@ -29,6 +29,8 @@ location:
29 29
 
30 30
 retention:
31 31
     # Retention policy for how many backups to keep in each category.
32
+    keep_minutely: 60
33
+    keep_hourly: 24
32 34
     keep_daily: 7
33 35
     keep_weekly: 4
34 36
     keep_monthly: 6

+ 4
- 0
borgmatic/config/schema.yaml View File

@@ -122,6 +122,10 @@ map:
122 122
                 type: scalar
123 123
                 desc: Keep all archives within this time interval.
124 124
                 example: 3H
125
+            keep_minutely:
126
+                type: int
127
+                desc: Number of minutely archives to keep.
128
+                example: 60
125 129
             keep_hourly:
126 130
                 type: int
127 131
                 desc: Number of hourly archives to keep.

+ 3
- 1
borgmatic/tests/integration/config/test_validate.py View File

@@ -44,6 +44,8 @@ def test_parse_configuration_transforms_file_into_mapping():
44 44
                 - hostname.borg
45 45
 
46 46
         retention:
47
+            keep_minutely: 60
48
+            keep_hourly: 24
47 49
             keep_daily: 7
48 50
 
49 51
         consistency:
@@ -57,7 +59,7 @@ def test_parse_configuration_transforms_file_into_mapping():
57 59
 
58 60
     assert result == {
59 61
         'location': {'source_directories': ['/home', '/etc'], 'repositories': ['hostname.borg']},
60
-        'retention': {'keep_daily': 7},
62
+        'retention': {'keep_daily': 7, 'keep_hourly': 24, 'keep_minutely': 60},
61 63
         'consistency': {'checks': ['repository', 'archives']},
62 64
     }
63 65
 

Loading…
Cancel
Save