mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-07 15:08:44 +00:00
Added --include/--exclude options to verify sub command
This commit is contained in:
parent
0f7d5a64a1
commit
e8ed99f300
1 changed files with 8 additions and 0 deletions
|
@ -171,6 +171,8 @@ def do_verify(self, args):
|
|||
keychain = Keychain(args.keychain)
|
||||
archive = Archive(store, keychain, args.archive.archive)
|
||||
for item in archive.get_items():
|
||||
if exclude_path(item['path'], args.patterns):
|
||||
continue
|
||||
if stat.S_ISREG(item['mode']) and not 'source' in item:
|
||||
self.print_verbose('%s ...', item['path'].decode('utf-8'), newline=False)
|
||||
if archive.verify_file(item):
|
||||
|
@ -282,6 +284,12 @@ def run(self, args=None):
|
|||
|
||||
subparser= subparsers.add_parser('verify')
|
||||
subparser.set_defaults(func=self.do_verify)
|
||||
subparser.add_argument('-i', '--include', dest='patterns',
|
||||
type=IncludePattern, action='append',
|
||||
help='Include condition')
|
||||
subparser.add_argument('-e', '--exclude', dest='patterns',
|
||||
type=ExcludePattern, action='append',
|
||||
help='Include condition')
|
||||
subparser.add_argument('archive', metavar='ARCHIVE',
|
||||
type=location_validator(archive=True),
|
||||
help='Archive to verity integrity of')
|
||||
|
|
Loading…
Reference in a new issue