mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-24 15:12:00 +00:00
check: print non-exit-code warning if --last or --prefix aren't fulfilled
This commit is contained in:
parent
be8e0c89b3
commit
fe6b03a72d
1 changed files with 4 additions and 0 deletions
|
@ -1100,8 +1100,12 @@ def valid_item(obj):
|
||||||
key=lambda name_info: name_info[1][b'time'])
|
key=lambda name_info: name_info[1][b'time'])
|
||||||
if prefix is not None:
|
if prefix is not None:
|
||||||
archive_items = [item for item in archive_items if item[0].startswith(prefix)]
|
archive_items = [item for item in archive_items if item[0].startswith(prefix)]
|
||||||
|
if not archive_items:
|
||||||
|
logger.warning('--prefix %s does not match any archives', prefix)
|
||||||
num_archives = len(archive_items)
|
num_archives = len(archive_items)
|
||||||
end = None if last is None else min(num_archives, last)
|
end = None if last is None else min(num_archives, last)
|
||||||
|
if last is not None and end < last:
|
||||||
|
logger.warning('--last %d archives: only found %d archives', last, end)
|
||||||
else:
|
else:
|
||||||
# we only want one specific archive
|
# we only want one specific archive
|
||||||
archive_items = [item for item in self.manifest.archives.items() if item[0] == archive]
|
archive_items = [item for item in self.manifest.archives.items() if item[0] == archive]
|
||||||
|
|
Loading…
Reference in a new issue