diff --git a/backups/rsyncvolumes/plan.py b/backups/rsyncvolumes/plan.py index d62d6cc..473f1ae 100644 --- a/backups/rsyncvolumes/plan.py +++ b/backups/rsyncvolumes/plan.py @@ -27,15 +27,18 @@ zippath = DEST + zipname # Zip files -EXCLUDE_WORDS = environ.get('EXCLUDE_WORDS', '') -EXCLUDE_WORDS = EXCLUDE_WORDS.split(',') +EXCLUDE_WORDS = environ.get('EXCLUDE_WORDS', False) +if EXCLUDE_WORDS: + EXCLUDE_WORDS = EXCLUDE_WORDS.split(',') def zipdir(path, ziph): # ziph is zipfile handle for root, dirs, files in walk(path): for file in files: pfile = osjoin(root, file) - if isfile(pfile) and all(map(lambda w: w not in pfile, EXCLUDE_WORDS)): + if (isfile(pfile) + and EXCLUDE_WORDS + and all(map(lambda w: w not in pfile, EXCLUDE_WORDS))): ziph.write(pfile) print('Compression started')