From fe6b03a72d9d7db8d1a0a4eace2c3bbd142002c7 Mon Sep 17 00:00:00 2001 From: Marian Beermann Date: Wed, 4 Jan 2017 19:32:39 +0100 Subject: [PATCH] check: print non-exit-code warning if --last or --prefix aren't fulfilled --- borg/archive.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/borg/archive.py b/borg/archive.py index afc734cef..26ad16455 100644 --- a/borg/archive.py +++ b/borg/archive.py @@ -1100,8 +1100,12 @@ class ArchiveChecker: key=lambda name_info: name_info[1][b'time']) if prefix is not None: 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) 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: # we only want one specific archive archive_items = [item for item in self.manifest.archives.items() if item[0] == archive]