소스 검색

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

Thomas LEVEIL 7 년 전
부모
커밋
24b5eccefc
3개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  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

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

+ 4 - 0
borgmatic/config/schema.yaml

@@ -122,6 +122,10 @@ map:
                 type: scalar
                 type: scalar
                 desc: Keep all archives within this time interval.
                 desc: Keep all archives within this time interval.
                 example: 3H
                 example: 3H
+            keep_minutely:
+                type: int
+                desc: Number of minutely archives to keep.
+                example: 60
             keep_hourly:
             keep_hourly:
                 type: int
                 type: int
                 desc: Number of hourly archives to keep.
                 desc: Number of hourly archives to keep.

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

@@ -44,6 +44,8 @@ def test_parse_configuration_transforms_file_into_mapping():
                 - hostname.borg
                 - hostname.borg
 
 
         retention:
         retention:
+            keep_minutely: 60
+            keep_hourly: 24
             keep_daily: 7
             keep_daily: 7
 
 
         consistency:
         consistency:
@@ -57,7 +59,7 @@ def test_parse_configuration_transforms_file_into_mapping():
 
 
     assert result == {
     assert result == {
         'location': {'source_directories': ['/home', '/etc'], 'repositories': ['hostname.borg']},
         'location': {'source_directories': ['/home', '/etc'], 'repositories': ['hostname.borg']},
-        'retention': {'keep_daily': 7},
+        'retention': {'keep_daily': 7, 'keep_hourly': 24, 'keep_minutely': 60},
         'consistency': {'checks': ['repository', 'archives']},
         'consistency': {'checks': ['repository', 'archives']},
     }
     }