diff --git a/backups/rsyncvolumes/plan.py b/backups/rsyncvolumes/plan.py index 473f1ae..b00bdb0 100644 --- a/backups/rsyncvolumes/plan.py +++ b/backups/rsyncvolumes/plan.py @@ -36,9 +36,8 @@ def zipdir(path, ziph): for root, dirs, files in walk(path): for file in files: pfile = osjoin(root, file) - if (isfile(pfile) - and EXCLUDE_WORDS - and all(map(lambda w: w not in pfile, EXCLUDE_WORDS))): + is_excluded = EXCLUDE_WORDS and any(map(lambda w: w in pfile, EXCLUDE_WORDS)) + if (isfile(pfile) and not is_excluded): ziph.write(pfile) print('Compression started')