Browse Source

Support for Borg create --progress via borgmatic command-line flag (#108).

Dan Helfman 3 weeks ago
parent
commit
9ca80a54d8
5 changed files with 18 additions and 1 deletions
  1. 3
    0
      NEWS
  2. 2
    0
      borgmatic/borg/create.py
  3. 11
    0
      borgmatic/commands/borgmatic.py
  4. 1
    0
      scripts/find-unsupported-borg-options
  5. 1
    1
      setup.py

+ 3
- 0
NEWS View File

@@ -1,3 +1,6 @@
1
+1.2.11
2
+ * #108: Support for Borg create --progress via borgmatic command-line flag.
3
+
1 4
 1.2.10
2 5
  * #105: Support for Borg --chunker-params create option via "chunker_params" in borgmatic's storage
3 6
    section.

+ 2
- 0
borgmatic/borg/create.py View File

@@ -104,6 +104,7 @@ def create_archive(
104 104
     storage_config,
105 105
     local_path='borg',
106 106
     remote_path=None,
107
+    progress=False,
107 108
     json=False,
108 109
 ):
109 110
     '''
@@ -151,6 +152,7 @@ def create_archive(
151 152
         + (('--stats',) if not dry_run and logger.isEnabledFor(logging.INFO) else ())
152 153
         + (('--debug', '--show-rc') if logger.isEnabledFor(logging.DEBUG) else ())
153 154
         + (('--dry-run',) if dry_run else ())
155
+        + (('--progress',) if progress else ())
154 156
         + (('--json',) if json else ())
155 157
     )
156 158
 

+ 11
- 0
borgmatic/commands/borgmatic.py View File

@@ -78,6 +78,13 @@ def parse_arguments(*arguments):
78 78
         action='store_true',
79 79
         help='Display summary information on archives',
80 80
     )
81
+    parser.add_argument(
82
+        '--progress',
83
+        dest='progress',
84
+        default=False,
85
+        action='store_true',
86
+        help='Display progress with --create option for each file as it is backed up',
87
+    )
81 88
     parser.add_argument(
82 89
         '--json',
83 90
         dest='json',
@@ -103,6 +110,9 @@ def parse_arguments(*arguments):
103 110
 
104 111
     args = parser.parse_args(arguments)
105 112
 
113
+    if args.progress and not args.create:
114
+        raise ValueError('The --progress option can only be used with the --create option')
115
+
106 116
     if args.json and not (args.create or args.list or args.info):
107 117
         raise ValueError(
108 118
             'The --json option can only be used with the --create, --list, or --info options'
@@ -212,6 +222,7 @@ def _run_commands_on_repository(
212 222
             storage,
213 223
             local_path=local_path,
214 224
             remote_path=remote_path,
225
+            progress=args.progress,
215 226
         )
216 227
     if args.check and checks.repository_enabled_for_checks(repository, consistency):
217 228
         logger.info('{}: Running consistency checks'.format(repository))

+ 1
- 0
scripts/find-unsupported-borg-options View File

@@ -40,6 +40,7 @@ for sub_command in prune create check list info; do
40 40
             | grep -v '^--list$' \
41 41
             | grep -v '^--nobsdflags$' \
42 42
             | grep -v '^--pattern$' \
43
+            | grep -v '^--progress$' \
43 44
             | grep -v '^--read-special$' \
44 45
             | grep -v '^--repository-only$' \
45 46
             | grep -v '^--show-rc$' \

+ 1
- 1
setup.py View File

@@ -1,7 +1,7 @@
1 1
 from setuptools import setup, find_packages
2 2
 
3 3
 
4
-VERSION = '1.2.10'
4
+VERSION = '1.2.11'
5 5
 
6 6
 
7 7
 setup(

Loading…
Cancel
Save